:root {
    --text: #333333;
    --bg: #f5f6f6;
    --muted: #8a8a8a;
    --link: #333333;
    --border: #e5e5e5;
}

html.dark {
    --text: #fafafa;
    --bg: #212121;
    --muted: #b0b0b0;
    --link: #fafafa;
    --border: #474747;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    transition: background-color .15s ease, color .15s ease;
}

body {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.125rem;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

main {
    max-width: 640px;
    margin: 0 auto;
    padding: 4rem 1.5rem 6rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.5rem;
}

h2, h3, h4 {
    font-weight: 600;
    line-height: 1.5;
    margin: 2.5rem 0 1rem;
}

p {
    margin: 0 0 1.5rem;
}

time {
    display: block;
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 2.5rem;
}

a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem 0;
}

.sentence {
    transition: color .1s ease;
}

.sentence:hover {
    color: #000000;
}

html.dark .sentence:hover {
    color: #ffffff;
}

#live-text {
    white-space: pre-wrap;
}

.post + .post {
    margin-top: 5rem;
    padding-top: 5rem;
    border-top: 1px solid var(--border);
}

#theme-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text);
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity .15s ease, background-color .15s ease;
}

#theme-toggle:hover {
    opacity: 1;
}

#live-link {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
}

#live-link:hover {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

#live-link.live-active {
    color: var(--text);
}

#live-link.live-active::after {
    content: '';
    position: absolute;
    left: -3px;
    right: -3px;
    top: 50%;
    border-top: 1px solid currentColor;
    transform: rotate(-14deg);
}
