:root {
    --bg: #0d0f12;
    --surface: #15181d;
    --border: #292e36;
    --text: #e8e8e8;
    --muted: #9299a3;
    --accent: #8fd3ff;
    --system: #c7b8ff;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.8;
}

a {
    color: inherit;
}

.site-header,
main,
.site-footer {
    width: min(920px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.site-title {
    font-family: monospace;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 20px;
}

nav a,
.footer-links a {
    color: var(--muted);
    text-decoration: none;
}

nav a:hover,
.footer-links a:hover {
    color: var(--text);
}

main {
    padding: 88px 0 120px;
}

.story {
    max-width: 760px;
    margin: 0 auto;
}

.story-header {
    margin-bottom: 72px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-family: monospace;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

h1 {
    margin: 0;
    font-family: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
    font-size: clamp(2.2rem, 7vw, 5rem);
    font-weight: 500;
    letter-spacing: 0.03em;
    line-height: 1.05;
}

.author {
    margin-top: 20px;
    color: var(--muted);
    font-size: 0.95rem;
}

.story-opening {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    line-height: 2;
    text-align: center;
}

.process {
    margin-top: 96px;
}

.process > h2 {
    margin: 0 0 36px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--system);
    font-family: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
    font-size: 0.92rem;
    font-weight: 400;
    letter-spacing: 0.08em;
}

.process-context {
    color: var(--muted);
}

.log-entry {
    margin-top: 56px;
}

.log-entry h3 {
    margin: 0 0 22px;
    color: var(--text);
    font-family: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.system-entry h3 {
    color: var(--system);
}

.story-log {
    margin: 0;
    color: #d8dce2;
    font-family: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
    font-size: 0.95rem;
    line-height: 1.85;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.response {
    color: var(--accent);
}

.state-line {
    color: var(--text);
    font-weight: 700;
}

.publication-note {
    margin-top: 96px;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
}

.publication-note p {
    margin: 0 0 8px;
    color: var(--muted);
}

.publication-note a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.publication-note a:hover {
    color: var(--text);
}

.story-footer {
    margin-top: 120px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.story-footer a {
    color: var(--accent);
    text-decoration: none;
}

.story-footer a:hover {
    color: var(--text);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 40px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 16px;
}

@media (max-width: 640px) {
    .site-header,
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    main {
        padding-top: 56px;
    }

    .story-header {
        margin-bottom: 56px;
    }

    .story-opening {
        font-size: 1.05rem;
        text-align: left;
    }

    .process {
        margin-top: 72px;
    }

    .process > h2 {
        margin-bottom: 28px;
    }

    .log-entry {
        margin-top: 44px;
    }

    .story-log {
        font-size: 0.86rem;
        line-height: 1.8;
    }

    .publication-note {
        margin-top: 72px;
        padding: 18px 20px;
    }
}
