/* Base reset */
* {
    box-sizing: border-box;
}

:root {
    --bg: #fff;
    --fg: #111;
    --muted: #555;
    --meta: #666;
    --link: #0055cc;
    --border: #e2e2e2;
}

[data-theme="dark"] {
    --bg: #0f0f0f;
    --fg: #eaeaea;
    --muted: #9a9a9a;
    --meta: #888;
    --link: #6ea8ff;
    --border: #2a2a2a;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);

    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 18px;
    line-height: 1.7;
}

/* Layout */
header,
main {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.site-title {
    margin: 0;
    font-size: 28px;
    font-weight: normal;
}

.site-title a {
    color: var(--fg);
    text-decoration: none;
}

nav {
    margin-top: 12px;
}

nav a {
    margin-right: 16px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

/* Content */
main h1,
main h2,
main h3 {
    font-weight: normal;
}

main h1 {
    font-size: 26px;
    margin-top: 0;
}

main h2 {
    font-size: 22px;
    margin-top: 40px;
}

p {
    margin: 20px 0;
}

ul {
    padding-left: 20px;
}

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

a:hover {
    text-decoration: underline;
}

.post-meta {
    font-size: 14px;
    color: var(--meta);
    margin-top: -10px;
    margin-bottom: 30px;
}

.socials a {
    color: var(--muted);
    margin-right: 14px;
    text-decoration: none;
    display: inline-block;
    vertical-align: middle;
}

.socials a:hover {
    color: var(--fg);
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.theme-toggle:hover {
    border-color: var(--muted);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* View transition: circular reveal from the toggle */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

::view-transition-old(root) {
    z-index: 1;
}

::view-transition-new(root) {
    z-index: 2;
    animation: theme-reveal 0.55s ease-out;
}

@keyframes theme-reveal {
    from {
        clip-path: circle(0 at var(--vt-x, 100%) var(--vt-y, 0));
    }
    to {
        clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 100%) var(--vt-y, 0));
    }
}
