:root {
    --text-primary: #1a1a1a; --text-secondary: #555; --text-tertiary: #999;
    --bg-primary: #fbfbfb; --bg-secondary: #f3f3f3; --accent: #1a1a1a; --border: #e5e5e5;
    --glow-color: rgba(0, 0, 0, 0.04);
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Lora', serif; background: var(--bg-primary); color: var(--text-primary);
    line-height: 1.8; font-size: 19px; overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

/* --- UI CONTROLS --- */
.theme-toggle {
    position: fixed; top: 25px; right: 25px;
    background: none; border: none; width: 24px; height: 24px;
    z-index: 100; cursor: pointer; padding: 0;
}
.theme-toggle svg { width: 100%; height: 100%; fill: var(--text-tertiary); transition: fill 0.3s ease, transform 0.5s cubic-bezier(0.5, -0.75, 0.25, 1.75); }
.theme-toggle:hover svg { fill: var(--text-primary); transform: rotate(20deg) scale(1.1); }
.theme-toggle .moon, .theme-toggle .sun { transform-origin: center center; transition: transform 0.5s cubic-bezier(0.5, -0.75, 0.25, 1.75); }
.dark-mode .theme-toggle .sun { transform: scale(0); }
.dark-mode .theme-toggle .moon { transform: scale(1) rotate(-30deg); }
.theme-toggle .moon { transform: scale(0) rotate(30deg); }

/* --- SITE NAVIGATION --- */
.site-nav {
    text-align: center;
    padding: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 40px;
}
.site-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 5px 10px;
    margin: 0 10px;
    position: relative;
    transition: color 0.3s ease;
}
.site-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}
.site-nav a:hover { color: var(--text-primary); }
.site-nav a.active { color: var(--text-primary); font-weight: 500; }
.site-nav a.active::after { width: 100%; }

/* --- GENERAL LAYOUT --- */
.container { max-width: 720px; margin: 0 auto; padding: 0 40px 100px; }
.view { animation: fadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- THOUGHTS VIEW --- */
#blog-search {
    width: 100%; padding: 15px 20px; font-family: 'Inter', sans-serif; font-size: 1rem;
    border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary);
    border-radius: 8px; margin-bottom: 50px; transition: all 0.3s ease;
}
#blog-search::placeholder { color: var(--text-tertiary); font-style: italic; }
#blog-list { list-style: none; }
#blog-list li a {
    position: relative; display: block; padding: 30px 25px; text-decoration: none;
    border-bottom: 1px solid var(--border); overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease; cursor: pointer;
}
#blog-list li:first-child a { border-top: 1px solid var(--border); }
#blog-list li a:hover { background-color: var(--bg-secondary); transform: translateY(-4px); box-shadow: 0 12px 35px -10px rgba(0,0,0,0.1); }
.item-title { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 1.25rem; color: var(--text-primary); line-height: 1.4; }
.item-excerpt { font-family: 'Lora', serif; font-size: 1rem; color: var(--text-secondary); line-height: 1.7; margin: 12px 0 16px; }
.item-context { font-family: 'Inter', sans-serif; font-size: 0.8rem; color: var(--text-tertiary); }

/* --- ABOUT VIEW --- */
.page-title { font-family: 'Inter', sans-serif; font-size: 2rem; font-weight: 500; color: var(--text-primary); margin-bottom: 40px; text-align: center; }
.about-content p { margin-bottom: 1.5em; }

/* --- SINGLE POST VIEW --- */
.back-to-index { display: inline-block; font-family: 'Inter', sans-serif; font-size: 0.9rem; color: var(--text-secondary); text-decoration: none; margin-bottom: 50px; transition: all 0.3s ease; }
.back-to-index .arrow { display: inline-block; transition: transform 0.25s ease; }
.back-to-index:hover { color: var(--text-primary); }
.back-to-index:hover .arrow { transform: translateX(-4px); }
.thought-meta { display: flex; align-items: baseline; gap: 12px; margin-bottom: 30px; font-family: 'Inter', sans-serif; font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; }
.thought-title { font-family: 'Inter', sans-serif; font-size: 2rem; font-weight: 500; color: var(--text-primary); margin-bottom: 40px; line-height: 1.3; }
.thought-content p, .thought-content h3 { margin-bottom: 1.5em; }
.thought-content h3 { font-family: 'Inter', sans-serif; font-size: 1.4rem; font-weight: 500; margin-top: 2.5em; }
.philosophical-quote { border-left: 3px solid var(--border); padding: 25px 30px; margin: 40px 0; font-style: italic; font-size: 1.15rem; color: var(--text-secondary); }

/* --- View Switching --- */
.view { display: none; }
body[data-active-view="thoughts"] #thoughts-view,
body[data-active-view="about"] #about-view,
body[data-active-view="post"] #post-viewer { display: block; }

/* --- DARK MODE & SELECTION --- */
body.dark-mode {
    --text-primary: #e8e8e8; --text-secondary: #ffffff; --text-tertiary: #666;
    --bg-primary: #121212; --bg-secondary: #1e1e1e; --border: #333; --accent: #ffffff;
    --glow-color: rgba(255, 255, 255, 0.05);
}
body.dark-mode #blog-list li a:hover { box-shadow: 0 12px 35px -10px rgba(0,0,0,0.3); }
::selection { background: var(--accent); color: var(--bg-primary); }