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

body {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1rem;
    color: #222;
    background: #fafaf8;
    position: relative;
}

header a {
    text-decoration: none;
    color: inherit;
}

header h1 {
    font-size: 1.6rem;
    margin-bottom: 0.2rem;
}

.tagline {
    font-style: italic;
    color: #666;
    margin-bottom: 2rem;
}

nav {
    margin-top: 0.5rem;
}

nav a {
    font-size: 1rem;
    color: #222;
    text-decoration: none;
    font-weight: bold;
}

nav a:hover {
    color: #555;
}

h2 {
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
}

/* Link colors */
a {
    color: #2c5282;
    text-decoration: none;
}

a:hover {
    color: #1a3a5c;
}

section ul {
    list-style: none;
    padding: 0;
}

section li {
    margin-bottom: 0.4rem;
}

section li a {
    color: #222;
    text-decoration: none;
}

section li a:hover {
    color: #555;
}

section li time {
    display: inline;
    font-size: 0.8rem;
    color: #888;
    margin-left: 0.5rem;
}

article {
    margin-bottom: 3rem;
}

article h2 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

article h2 a {
    text-decoration: none;
    color: #222;
}

article h2 a:hover {
    color: #555;
}

time {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

article p {
    margin-bottom: 1rem;
}

.back a {
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
}

.back a:hover {
    color: #222;
}

.older {
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.older a {
    font-size: 1rem;
    color: #666;
    text-decoration: none;
    font-style: italic;
}

.older a:hover {
    color: #222;
}

footer {
    margin-top: 4rem;
    font-size: 0.8rem;
    color: #aaa;
    text-align: center;
}

/* Write form */
.write-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.write-form label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #444;
}
.write-form input, .write-form textarea {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #222;
}
.write-form textarea {
    resize: vertical;
    line-height: 1.7;
}
.write-form button {
    align-self: flex-start;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
    background: #2c5282;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.write-form button:hover {
    background: #1a3a5c;
}

/* File input styling for write form */
.write-form input[type="file"] {
    font-size: 0.9rem;
    padding: 0.25rem;
}

/* Post images */
article img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 0 1rem 0;
    border-radius: 4px;
}

/* Dashboard post list */
.dashboard {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}
.dashboard h2 {
    margin-bottom: 1rem;
}
.dashboard ul {
    list-style: none;
    padding: 0;
}
.dashboard li {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.dashboard li a {
    color: #2c5282;
}
.dashboard li a:hover {
    color: #1a3a5c;
}
.dashboard li time {
    display: inline;
    font-size: 0.8rem;
    color: #888;
    margin-left: 1rem;
    flex-shrink: 0;
}

/* Delete form */
.delete-form {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}
.delete-form button {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    background: #c53030;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.delete-form button:hover {
    background: #9b2c2c;
}

/* Preview */
.preview-toggle {
    margin-top: 0.25rem;
}
.preview-toggle button {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
    background: #2c5282;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.preview-toggle button:hover {
    background: #1a3a5c;
}
.preview {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    line-height: 1.7;
}
.preview p {
    margin-bottom: 1rem;
}

/* Tables */
article table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
}

article th,
article td {
    border: 1px solid #ddd;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

article th {
    background: #f0f0ee;
    font-weight: bold;
}

/* Task lists */
article ul .task-list {
    list-style: none;
    padding-left: 0;
}

article .task-list-item {
    margin-bottom: 0.25rem;
}

/* Strikethrough */
article del {
    color: #888;
}

/* Highlight/mark */
article mark {
    background: #fff3a8;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

/* Footnotes */
article .footnote {
    font-size: 0.85rem;
    color: #666;
}

article .footnote-ref {
    font-size: 0.75rem;
    vertical-align: super;
}

/* Code blocks */
article code {
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9rem;
    background: #f0f0ee;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
}

article pre {
    background: #f0f0ee;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

article pre code {
    background: none;
    padding: 0;
}

/* Preview tables and code */
.preview table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
}
.preview th, .preview td {
    border: 1px solid #ddd;
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.preview th {
    background: #f0f0ee;
}
.preview code {
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9rem;
    background: #f0f0ee;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
}
.preview pre {
    background: #f0f0ee;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1rem;
}
.preview pre code {
    background: none;
    padding: 0;
}

/* Header controls container */
/* Holds RSS icon and theme toggle in top right */
.header-controls {
    position: absolute;
    top: 2rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Theme toggle button */
/* Removed position absolute since container handles it */
#theme-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* Dark mode */
[data-theme="dark"] body {
    background: #1a1a1a;
    color: #d4d4d4;
}

[data-theme="dark"] a {
    color: #d4d4d4;
}

[data-theme="dark"] a:hover {
    color: #aaa;
}

[data-theme="dark"] header a {
    color: #d4d4d4;
}

[data-theme="dark"] .tagline {
    color: #888;
}

[data-theme="dark"] article h2 a {
    color: #d4d4d4;
}

[data-theme="dark"] article h2 a:hover {
    color: #aaa;
}

[data-theme="dark"] time {
    color: #777;
}

[data-theme="dark"] .back a {
    color: #888;
}

[data-theme="dark"] .back a:hover {
    color: #d4d4d4;
}

[data-theme="dark"] .older a {
    color: #888;
}

[data-theme="dark"] .older a:hover {
    color: #d4d4d4;
}

[data-theme="dark"] footer {
    color: #555;
}

[data-theme="dark"] section li a {
    color: #d4d4d4;
}

[data-theme="dark"] section li a:hover {
    color: #aaa;
}

[data-theme="dark"] section li time {
    color: #777;
}

[data-theme="dark"] #theme-toggle {
    color: #d4d4d4;
}
[data-theme="dark"] .write-form label {
    color: #aaa;
}

[data-theme="dark"] .write-form input,
[data-theme="dark"] .write-form textarea {
    background: #2a2a2a;
    border-color: #444;
    color: #d4d4d4;
}

[data-theme="dark"] .write-form button {
    background: #4a7ab5;
}

[data-theme="dark"] .write-form button:hover {
    background: #5a8ac5;
}

[data-theme="dark"] .dashboard {
    border-top-color: #444;
}

[data-theme="dark"] .dashboard li a {
    color: #8ab4f8;
}

[data-theme="dark"] .dashboard li a:hover {
    color: #aaa;
}

[data-theme="dark"] .dashboard li time {
    color: #777;
}

[data-theme="dark"] .delete-form {
    border-top-color: #444;
}

[data-theme="dark"] .delete-form button {
    background: #c53030;
}

[data-theme="dark"] .delete-form button:hover {
    background: #e53e3e;
}

[data-theme="dark"] .preview-toggle button {
    background: #4a7ab5;
    color: #fff;
}

[data-theme="dark"] .preview-toggle button:hover {
    background: #5a8ac5;
}

[data-theme="dark"] .preview {
    background: #2a2a2a;
    border-color: #444;
    color: #d4d4d4;
}

[data-theme="dark"] article th,
[data-theme="dark"] .preview th {
    background: #2a2a2a;
}

[data-theme="dark"] article td,
[data-theme="dark"] article th,
[data-theme="dark"] .preview td,
[data-theme="dark"] .preview th {
    border-color: #444;
}

[data-theme="dark"] article del {
    color: #666;
}

[data-theme="dark"] article mark {
    background: #5a4800;
    color: #d4d4d4;
}

[data-theme="dark"] article code,
[data-theme="dark"] .preview code {
    background: #2a2a2a;
    color: #d4d4d4;
}

[data-theme="dark"] article pre,
[data-theme="dark"] .preview pre {
    background: #2a2a2a;
}

[data-theme="dark"] article .footnote {
    color: #888;
}









/* 404 sky page */
#sky-arena {
    position: relative;
    height: 250px;
    margin: 2rem 0 1rem 0;
    overflow: hidden;
    background: #d4e8f7;
    border-radius: 4px;
}

[data-theme="dark"] #sky-arena {
    background: #1a2a3a;
}

#cloud {
    position: absolute;
    font-size: 8rem;
    top: 10px;
    left: -100px;
    transition: transform 0.2s ease;
    user-select: none;
}

#sky-response {
    text-align: center;
    font-style: italic;
    color: #888;
    font-size: 1rem;
    min-height: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

[data-theme="dark"] #sky-response {
    color: #666;
}

#fist {
    position: absolute;
    font-size: 2.5rem;
    display: none;
    pointer-events: none;
    z-index: 10;
    user-select: none;
}