@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@400;500;600&display=swap');

:root {
    --bg: #faf8f5;
    --text: #2d2a26;
    --text-secondary: #6b6560;
    --border: #e5e0d8;
    --accent: #1f1d1a;
    --glow-1: rgba(255, 255, 255, 0.7);
    --glow-2: rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] {
    --bg: #1f1d1a;
    --text: #e8e4df;
    --text-secondary: #a09a92;
    --border: #3d3830;
    --accent: #e8e4df;
    --glow-1: rgba(255, 255, 255, 0.08);
    --glow-2: rgba(255, 255, 255, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
}

body {
    font-family: 'Shippori Mincho', serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    background-image:
        radial-gradient(800px 520px at 8% -10%, var(--glow-1), transparent 60%),
        radial-gradient(640px 460px at 92% 0%, var(--glow-2), transparent 55%);
    background-attachment: fixed;
}

p + p {
    margin-top: 1rem;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 4rem 1.5rem 5rem;
    position: relative;
    z-index: 1;
}

.page-stack > :not(.site-header) {
    animation: rise 0.6s ease both;
    animation-delay: var(--delay, 0s);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 2.5rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text);
    margin: 0;
    text-decoration: none;
}

.site-title a {
    color: inherit;
    text-decoration: none;
}

.site-tagline {
    color: var(--text-secondary);
    font-size: 1rem;
}

.site-tagline a {
    color: inherit;
    text-decoration: none;
}

.site-tagline a:hover {
    text-decoration: underline;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
}

.nav a[aria-current="page"],
.nav a:hover {
    color: var(--text);
}

.intro {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.section-block {
    margin-top: 2.5rem;
}

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

a:hover {
    text-decoration-color: var(--accent);
}

.book-list a {
    text-decoration: none;
}

.book-list a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

ul {
    list-style: none;
    padding: 0;
}

.writing-item,
.book-item {
    margin-bottom: 1.1rem;
}

.writing-item a {
    text-decoration: none;
}

.writing-item a:hover {
    text-decoration: underline;
}

.writing-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.writing-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.book-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.book-notes {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

.site-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    padding: 0.75rem;
    z-index: 10;
}

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

.theme-toggle svg {
    width: 1.05rem;
    height: 1.05rem;
}

:focus-visible {
    outline: 2px solid var(--text-secondary);
    outline-offset: 3px;
}

@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    .container {
        padding: 3rem 1.25rem 4rem;
    }

    .nav {
        gap: 1rem;
    }
}
