:root {
    --bg: #1e1e2e;
    --text: #cdd6f4;
    --muted: #a6adc8;
    --link: #89b4fa;
    --link-underline: rgba(137, 180, 250, 0.3);
    --code-bg: #313244;
    --border: #45475a;
    --selection: #45475a;
    --font-body: 'Poppins', system-ui, sans-serif;
    --font-mono: 'Fira Code', 'FiraCode Nerd Font Mono', ui-monospace, monospace;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #eff1f5;
        --text: #4c4f69;
        --muted: #9ca0b0;
        --link: #1e66f5;
        --link-underline: rgba(30, 102, 245, 0.3);
        --code-bg: #e6e9ef;
        --border: #ccd0da;
        --selection: #ccd0da;
    }
}

::selection {
    background-color: var(--selection);
}

* {
    box-sizing: border-box;
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    margin-bottom: 35px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 60px;
}

nav .site-name {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

nav .site-name:hover {
    color: var(--text);
    opacity: 0.7;
    text-decoration: none;
}

nav .nav-links a {
    color: var(--muted);
    font-size: 14px;
    margin-left: 20px;
}

nav .nav-links a:hover {
    color: var(--link);
}

h2 {
    font-size: 13px;
    font-weight: 700;
    margin-top: 35px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

p {
    margin: 0 0 12px 0;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

hr {
    border: 0;
    border-top: 1px dashed var(--border);
    margin: 20px 0;
}

ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

li {
    margin-bottom: 12px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.item-detail {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
    margin-left: 15px;
}

.desc {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 2px;
    line-height: 1.5;
}

code {
    font-family: var(--font-mono);
    background-color: var(--code-bg);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 14px;
}

pre {
    margin: 20px 0;
    padding: 16px 20px;
    background-color: var(--code-bg);
    border-radius: 6px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.7;
    tab-size: 4;
    -moz-tab-size: 4;
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.codehilite {
    margin: 20px 0;
    font-size: 15px;
}

.codehilite pre {
    margin: 0;
}

article h1 {
    font-size: 14px;
    font-weight: 700;
    margin: 35px 0 4px 0;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
}

article h2 {
    margin-top: 35px;
    margin-bottom: 12px;
}

article h3 {
    font-size: 13px;
    font-weight: 700;
    margin-top: 25px;
    margin-bottom: 10px;
}

article p {
    margin-bottom: 14px;
}

article ul, article ol {
    list-style-position: inside;
    margin: 0 0 14px 0;
    padding-left: 0;
}

article ul {
    list-style-type: disc;
}

article ul li {
    margin-bottom: 6px;
    margin-left: 16px;
}

article ol li {
    margin-bottom: 6px;
    margin-left: 20px;
}

article blockquote {
    margin: 15px 0;
    padding: 8px 14px;
    border-left: 3px solid var(--border);
    color: var(--muted);
    font-style: italic;
}

article blockquote p {
    margin-bottom: 0;
}

article table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 12px;
}

article th, article td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

article th {
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 11px;
}

article tr:last-child td {
    border-bottom: none;
}

.post-meta {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 25px;
}

.post-title {
    margin-top: 0 !important;
}

footer {
    margin-top: auto;
    font-size: 11px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

footer a {
    color: var(--muted);
}

footer a:hover {
    color: var(--link);
}

.footer-links {
    display: flex;
    gap: 14px;
    margin-top: 10px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
}

.footer-links a:hover {
    color: var(--link);
}
