html {
    scroll-behavior: smooth;
}

:root {
    --bg: #faf9f6;
    --text: #2c2c2c;
    --text-heading: #1a1a1a;
    --text-muted: #555;
    --text-faint: #777;
    --text-faintest: #999;
    --accent: #1a5632;
    --accent-hover: #134225;
    --card-bg: #fff;
    --card-border: #e5e2db;
    --photo-border: #e5e2db;
    --footer-text: #aaa;
    --toggle-bg: #e5e2db;
    --toggle-knob: #fff;
}

[data-theme="dark"] {
    --bg: #1a1a1a;
    --text: #d4d4d4;
    --text-heading: #e8e8e8;
    --text-muted: #aaa;
    --text-faint: #888;
    --text-faintest: #777;
    --accent: #3a9e65;
    --accent-hover: #2f8554;
    --card-bg: #242424;
    --card-border: #333;
    --photo-border: #444;
    --footer-text: #666;
    --toggle-bg: #444;
    --toggle-knob: #1a1a1a;
}

.theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: 48px;
    height: 26px;
    background: var(--toggle-bg);
    border-radius: 13px;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s;
    z-index: 100;
}

.theme-toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--toggle-knob);
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle::after {
    transform: translateX(22px);
}

.theme-toggle-icons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    height: 100%;
    font-size: 0.75rem;
    pointer-events: none;
}

.site-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 0 auto 2.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    max-width: 560px;
}

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Georgia', serif;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    padding: 0.25rem 0;
    border-bottom: 1.5px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover {
    color: var(--accent);
}

.site-nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.back-to-top {
    display: block;
    text-align: center;
    color: var(--text-faintest);
    text-decoration: none;
    font-family: 'Georgia', serif;
    font-size: 0.85rem;
    padding: 1.5rem 1rem 0.5rem;
    transition: color 0.2s;
}

.back-to-top:hover {
    color: var(--accent);
}

.amazon-author-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
    display: inline-block;
    margin-bottom: 0.4rem;
}

.amazon-author-link:hover {
    border-bottom-color: var(--accent);
}

.logo-pre {
    font-size: 0.85rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: normal;
    margin-bottom: 0.15rem;
}
