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

html {
    background: #0a0a0a;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #0a0a0a;
    color: #d4d4d4;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
}

/* --- Navbar --- */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: #0a0a0a;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 80px 0 24px;
    z-index: 100;
}

.navbar-toc {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #777;
    text-decoration: none;
    transition: color 0.15s;
}

.navbar-toc:hover {
    color: #ccc;
}

.theme-toggle {
    position: fixed;
    top: 10px;
    right: 24px;
    background: none;
    border: 1px solid #333;
    color: #888;
    font-family: inherit;
    font-size: 0.75rem;
    padding: 4px 10px;
    cursor: pointer;
    letter-spacing: 0.05em;
    border-radius: 3px;
    z-index: 101;
}

.theme-toggle:hover {
    color: #bbb;
    border-color: #555;
}

/* --- Landing Page --- */

.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.home-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: #e8e8e8;
    letter-spacing: -0.02em;
}

.home-author {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    margin-top: 8px;
}

.home-disclaimer {
    font-size: 2.5rem;
    font-weight: 300;
    color: #e8e8e8;
    letter-spacing: -0.02em;
    margin-top: 32px;
}

.home-cta {
    margin-top: 48px;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: #666;
    border: 1px solid #333;
    padding: 10px 32px;
    border-radius: 3px;
    transition: color 0.15s, border-color 0.15s;
}

.home-cta:hover {
    color: #ccc;
    border-color: #555;
}

.home-legal {
    margin-top: 48px;
    font-size: 0.7rem;
    color: #444;
    text-align: center;
    line-height: 1.8;
    max-width: 360px;
}

.home-legal a {
    color: #555;
    text-decoration: none;
}

.home-legal a:hover {
    color: #ccc;
}

/* --- Layout --- */

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 80px 24px 120px;
}

/* --- Chapter Header --- */

.chapter-header {
    margin-bottom: 56px;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 32px;
}

.chapter-number {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 8px;
}

.chapter-title {
    font-size: 1.75rem;
    font-weight: 300;
    color: #e8e8e8;
    letter-spacing: -0.01em;
}

/* --- Chapter Body --- */

.chapter-body p {
    font-size: 1.05rem;
    margin-bottom: 1.4em;
    color: #c0c0c0;
}

.scene-break {
    text-align: center;
    margin: 2.5em 0;
    color: #444;
    font-size: 1.2rem;
    letter-spacing: 0.3em;
}

/* --- Chapter Navigation --- */

.chapter-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #1a1a1a;
}

.chapter-nav-link {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    color: #666;
    padding: 10px 0;
    transition: color 0.15s;
}

.chapter-nav-link:hover {
    color: #ccc;
}

.nav-next {
    margin-left: auto;
}

/* --- Table of Contents --- */

.toc-header {
    margin-bottom: 48px;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 24px;
}

.toc-title {
    font-size: 1.75rem;
    font-weight: 300;
    color: #e8e8e8;
    letter-spacing: -0.01em;
}

.toc-author {
    font-size: 0.9rem;
    color: #777;
    margin-top: 6px;
    font-style: italic;
}

.toc-disclaimer {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #444;
    margin-top: 16px;
}

.toc-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #555;
    margin-top: 8px;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    border-bottom: 1px solid #111;
}

.toc-list a {
    display: block;
    padding: 12px 0;
    text-decoration: none;
    color: #999;
    font-size: 0.95rem;
    transition: color 0.15s;
}

.toc-list a:hover {
    color: #e8e8e8;
}

.toc-list .ch-num {
    color: #555;
    display: inline-block;
    width: 4em;
    text-align: right;
    margin-right: 1em;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

/* --- Light Theme --- */

html.light,
html.light body {
    background: #fafafa;
    color: #222;
}

html.light .home-title {
    color: #111;
}

html.light .home-author {
    color: #888;
}

html.light .home-disclaimer {
    color: #111;
}

html.light .home-cta {
    color: #888;
    border-color: #ccc;
}

html.light .home-cta:hover {
    color: #333;
    border-color: #999;
}

.kofi-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #ccc;
    border: 1px solid #555;
    padding: 10px 20px;
    border-radius: 3px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.kofi-button:hover {
    color: #fff;
    border-color: #888;
    background: #1a1a1a;
}

html.light .kofi-button {
    color: #555;
    border-color: #999;
}

html.light .kofi-button:hover {
    color: #111;
    border-color: #555;
    background: #f0f0f0;
}

html.light .home-legal {
    color: #aaa;
}

html.light .home-legal a {
    color: #888;
}

html.light .home-legal a:hover {
    color: #333;
}

html.light .navbar {
    background: #fafafa;
    border-bottom: none;
}

html.light .navbar-toc {
    color: #999;
}

html.light .navbar-toc:hover {
    color: #333;
}

html.light .theme-toggle {
    border-color: #ccc;
    color: #777;
}

html.light .theme-toggle:hover {
    color: #444;
    border-color: #999;
}

html.light .chapter-header {
    border-bottom-color: #ddd;
}

html.light .chapter-number {
    color: #999;
}

html.light .chapter-title {
    color: #111;
}

html.light .chapter-body p {
    color: #333;
}

html.light .scene-break {
    color: #bbb;
}

html.light .chapter-nav {
    border-top-color: #ddd;
}

html.light .chapter-nav-link {
    color: #999;
}

html.light .chapter-nav-link:hover {
    color: #333;
}

html.light .toc-header {
    border-bottom-color: #ddd;
}

html.light .toc-title {
    color: #111;
}

html.light .toc-author {
    color: #888;
}

html.light .toc-disclaimer {
    color: #bbb;
}

html.light .toc-subtitle {
    color: #999;
}

html.light .toc-list li {
    border-bottom-color: #eee;
}

html.light .toc-list a {
    color: #555;
}

html.light .toc-list a:hover {
    color: #111;
}

html.light .toc-list .ch-num {
    color: #999;
}

/* --- Responsive --- */

@media (max-width: 600px) {
    .container {
        padding: 64px 18px 80px;
    }

    .chapter-title,
    .toc-title {
        font-size: 1.4rem;
    }

    .chapter-body p {
        font-size: 1rem;
    }

    .chapter-nav-link {
        font-size: 0.75rem;
    }
}
