#title {
    font-family: 'Zen Dots', sans-serif;
    font-size: clamp(1.8rem, 6vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0 0 1rem;
    position: relative;
    display: block;
    text-align: center;
    text-shadow: -2px -2px 0 #22c55e, 2px 2px 0 #8b5cf6;
    width: 100%;
}
#title::before {
    content: '';
    position: absolute;
    left: 0;
    width: 50%;
    height: 4px;
    top: calc(100% + 4px);
    background: #eee;
    border-radius: 2px 0 0 2px;
}
#title::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 50%;
    height: 4px;
    top: 100%;
    background: #eee;
    border-radius: 0 2px 2px 0;
}

body {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: system-ui;
    line-height: 1.6;
    background: #0c0e12;
    color: #aaa;
    overflow-x: auto;
}

hr {
    border: none;
    height: 4px;
    background: #eee;
    border-radius: 2px;
}

h1 {
    color: #eee;
}

a {
    color: #22c55e;
}

a:hover {
    text-decoration: none;
}

a:visited {
    color: #15803d;
}

a img {
    cursor: zoom-in;
    border: none;
}

a img:hover {
    opacity: 0.7;
}

article {
    scroll-margin-top: 80px;
    background: #111318;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 2rem;
}

blockquote {
    border-left: 4px solid #8b5cf6;
    margin: 1.5em 0;
    padding-left: 1em;
    color: #888;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
    margin-top: 2rem;
}

aside.toc {
    position: sticky;
    top: 30px;
    align-self: start;
    background: #111318;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #eee;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    color: #ccc;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#posts {
    overflow-x: auto;
    max-width: 100%;
}

.post {
    overflow-x: auto;
    max-width: 100%;
}

.post h1,
.post h2,
.post h3,
.post h4,
.post h5,
.post h6 {
    color: #ccc;
}

.post h2 {
    background: linear-gradient(to right, #111318, #8b5cf6);
}

.post img {
    max-width: 100%;
    height: auto;
    width: 100%;
    object-fit: contain;
    display: block;
}

.post-title {
    margin: 0 0 .35rem;
    line-height: 1.1;
}

.post-content {
    color: #e2e8f0;
    overflow-x: auto;
}

.code-wrapper {
    background: #000;
    max-width: 100%;
    overflow-x: auto;
    margin: 1rem -1.5rem;
    padding: 0 1.5rem;
}

.post-content pre {
    padding: 1rem;
    margin: 0;
    width: 100% !important;
    min-width: 0;
    max-width: none;
    white-space: pre;
    overflow-x: auto;
    display: block;
    box-sizing: border-box;
    background: transparent;
    border: 1px solid #eee;
}

.post-content code {
    background: #000;
    font-family: monospace;
    font-size: 0.95rem;
    line-height: 1.45;
    tab-size: 4;
    color: #888;
    padding: 0.2rem 0.2rem;
}

.post-content pre code {
    display: block;
    white-space: inherit;
    background: transparent
}

.post-date {
    font-size: 0.85rem;
    margin: 1.5rem 0 0;
    text-align: right;
    color: #888;
}

/* mobile layout switch on smaller screens */
@media (max-width: 900px) {
    .grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    aside.toc {
        order: -1;
        position: static;
        max-height: none;
        overflow-y: visible;
        width: 100%;
        margin: 0;
        padding: 1.5rem;
        background: #111318;
        border: 1px solid #eee;
        box-sizing: border-box;
    }

    aside.toc h2,
    aside.toc h3 {
        margin-top: 0;
        font-size: 1.1rem;
        color: #ccc;
    }

    .toc {
        display: none;
    }

    .post-content,
    .post,
    #posts {
        overflow-x: auto;
    }
}

.post-content input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.2em;
    height: 1.2em;
    margin: 0 .4em 0 0;
    vertical-align: middle;
    ;
    border: 2px solid #8b5cf6;
    border-radius: 4px;
    background: transparent;
    position: relative;
    cursor: default;
}

.post-content input[type="checkbox"] {
    background: transparent;
}

.post-content input[type="checkbox"]:checked {
    background: #8b5cf6;
}

.post-content input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    inset: 0;
    color: #fff;
    font-size: 1em;
    font-weight: bold;
    line-height: 1.1;
    text-align: center;
}

.post-content input[type="checkbox"]:hover {
    box-shadow: 0 0 0 3px rgba(139,92,246,.25);
}
