:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --accent-color: #a7c4a0;
    --accent-hover: #8fb088;
    --accent-subtle: rgba(167, 196, 160, 0.1);
    --transition: all 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0a0a;
        --bg-secondary: #111111;
        --text-primary: #e5e5e5;
        --text-secondary: #a3a3a3;
        --text-tertiary: #737373;
        --border-color: #262626;
        --accent-color: #a7c4a0;
        --accent-hover: #b8d4b1;
        --accent-subtle: rgba(167, 196, 160, 0.15);
    }
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: 
        radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(37, 99, 235, 0.02) 0%, transparent 50%),
        var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
.header {
    padding: 40px 0 48px;
    animation: fadeInDown 0.7s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.nav {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Main Content */
.main {
    flex: 1;
    padding: 32px 0;
}

/* Hero Section */
.hero {
    margin-bottom: 80px;
}

.hero-title {
    font-family: 'Lora', serif;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 48px;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--text-primary);
    animation: fadeInUp 0.75s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeInUp 0.75s cubic-bezier(0.4, 0, 0.2, 1) 0.1s backwards;
}

.hero-text {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 600px;
}

.inline-link {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-color);
    transition: var(--transition);
}

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

.current-activity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 8px;
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

.activity-label {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.activity-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Writing Section */
.writing-section {
    margin-bottom: 64px;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.15s backwards;
}

.writing-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Tagline Section */
.tagline-section {
    margin-bottom: 64px;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

.tagline-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    font-style: italic;
}

/* Location Section */
.location-section {
    margin-bottom: 80px;
    animation: fadeInUp 0.75s cubic-bezier(0.4, 0, 0.2, 1) 0.15s backwards;
}

.location-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.location-icon {
    opacity: 0.7;
    transition: var(--transition);
    color: var(--accent-color);
}

.location-text:hover .location-icon {
    opacity: 1;
}

/* Posts List */
.posts-section {
    margin-bottom: 64px;
}

.year-group {
    margin-bottom: 64px;
}

.year-heading {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.02em;
}

.posts-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-left: 0;
}

.post-list-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 24px;
    align-items: baseline;
}

.post-date {
    font-size: 15px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.post-list-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    transition: var(--transition);
    letter-spacing: -0.01em;
}

.post-list-link:hover {
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .post-list-item {
        grid-template-columns: 60px 1fr;
        gap: 16px;
    }
    
    .post-date {
        font-size: 14px;
    }
    
    .post-list-link {
        font-size: 16px;
    }
}

.post-item {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) backwards;
    opacity: 0;
}

.post-item:nth-child(1) { animation-delay: 0.1s; }
.post-item:nth-child(2) { animation-delay: 0.18s; }
.post-item:nth-child(3) { animation-delay: 0.26s; }
.post-item:nth-child(4) { animation-delay: 0.34s; }
.post-item:nth-child(5) { animation-delay: 0.42s; }

.post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.post-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: var(--transition);
}

.post-link:hover .post-title {
    color: var(--accent-color);
}

.post-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.3;
    transition: var(--transition);
}

.post-meta {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.post-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* Individual Blog Post */
.blog-post {
    animation: fadeIn 0.75s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.post-header {
    margin-bottom: 48px;
}

.post-title-full {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.post-meta-full {
    font-size: 15px;
    color: var(--text-tertiary);
}

.post-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-content p {
    margin-bottom: 24px;
}

.post-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 48px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.post-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 36px;
    margin-bottom: 16px;
}

.post-content ul,
.post-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.post-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.post-content a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.post-content a:hover {
    border-bottom-color: var(--accent-color);
    color: var(--accent-color);
}

/* Images in posts */
.post-content figure {
    margin: 32px 0;
    padding: 0;
}

.post-content figure img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

@media (prefers-color-scheme: dark) {
    .post-content figure img {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

.post-content figure img:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

@media (prefers-color-scheme: dark) {
    .post-content figure img:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
}

.post-content figcaption {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-tertiary);
    text-align: center;
    font-style: italic;
}

/* Blockquotes - Notion style */
.post-content blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border-left: 3px solid var(--accent-color);
    border-radius: 0 8px 8px 0;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-primary);
}

.post-content blockquote p {
    margin-bottom: 0;
}

/* Code blocks */
.post-content pre {
    margin: 24px 0;
    padding: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}

.post-content pre code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--text-primary);
    background: none;
    padding: 0;
}

/* Inline code */
.post-content code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    padding: 2px 6px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-primary);
}

/* Horizontal rule / divider */
.post-content hr {
    margin: 48px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Callouts - Notion style */
.post-content .callout {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.post-content span.callout-icon {
    font-size: 20px;
    line-height: 1.4;
    flex-shrink: 0;
}

.post-content img.callout-icon {
    display: none;
}

.post-content .callout-content {
    flex: 1;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Callout color variants */
.post-content .callout-gray_background { background-color: var(--bg-secondary); }
.post-content .callout-brown_background { background-color: rgba(159, 107, 83, 0.1); }
.post-content .callout-orange_background { background-color: rgba(217, 115, 13, 0.1); }
.post-content .callout-yellow_background { background-color: rgba(203, 145, 47, 0.1); }
.post-content .callout-green_background { background-color: rgba(68, 131, 97, 0.1); }
.post-content .callout-blue_background { background-color: rgba(51, 126, 169, 0.1); }
.post-content .callout-purple_background { background-color: rgba(144, 101, 176, 0.1); }
.post-content .callout-pink_background { background-color: rgba(193, 76, 138, 0.1); }
.post-content .callout-red_background { background-color: rgba(212, 76, 71, 0.1); }

/* Todo items */
.post-content .todo-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0;
    font-size: 16px;
    line-height: 1.6;
}

.post-content .todo-item input[type="checkbox"] {
    margin-top: 5px;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
}

.post-content .todo-checked {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

/* Bookmark links */
.post-content .bookmark-link {
    display: block;
    margin: 24px 0;
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.post-content .bookmark-link:hover {
    border-color: var(--accent-color);
    background-color: var(--accent-subtle);
}

/* Video embeds */
.post-content .video-embed {
    margin: 32px 0;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.post-content .video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.post-content video {
    max-width: 100%;
    border-radius: 8px;
    margin: 24px 0;
}

/* Embed containers */
.post-content .embed-container {
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
}

.post-content .embed-container iframe {
    width: 100%;
    min-height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Toggle/collapsible */
.post-content details.toggle {
    margin: 16px 0;
    padding: 12px 16px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.post-content details.toggle summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    list-style: none;
}

.post-content details.toggle summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 8px;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.post-content details.toggle[open] summary::before {
    transform: rotate(90deg);
}

.post-content .toggle-content {
    padding: 12px 0 0 24px;
}

/* Tables - Notion style */
.post-content .notion-table {
    width: 100%;
    margin: 24px 0;
    border-collapse: collapse;
    font-size: 15px;
}

.post-content .notion-table th,
.post-content .notion-table td {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}

.post-content .notion-table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.post-content .notion-table tr:hover td {
    background-color: var(--accent-subtle);
}

/* Columns layout */
.post-content .columns {
    display: flex;
    gap: 24px;
    margin: 24px 0;
}

.post-content .column {
    flex: 1;
    min-width: 0;
}

@media (max-width: 640px) {
    .post-content .columns {
        flex-direction: column;
        gap: 16px;
    }
}

/* Equations */
.post-content .equation {
    margin: 24px 0;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    overflow-x: auto;
}

/* Audio player */
.post-content .audio-player {
    width: 100%;
    margin: 24px 0;
    border-radius: 8px;
}

/* File downloads */
.post-content .file-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    padding: 12px 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
}

.post-content .file-download:hover {
    border-color: var(--accent-color);
    background-color: var(--accent-subtle);
}

/* Link previews */
.post-content .link-preview {
    display: block;
    margin: 24px 0;
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--accent-color);
    font-size: 15px;
    word-break: break-all;
    transition: var(--transition);
}

.post-content .link-preview:hover {
    border-color: var(--accent-color);
}

/* PDF embeds */
.post-content .pdf-embed {
    margin: 24px 0;
}

.post-content .pdf-embed iframe {
    width: 100%;
    height: 600px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.post-content .pdf-embed figcaption {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-tertiary);
    text-align: center;
}

/* Code block with language label */
.post-content .code-block {
    margin: 24px 0;
}

.post-content .code-caption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: right;
}

/* Todo children nesting */
.post-content .todo-children {
    margin-left: 26px;
    margin-top: 8px;
}

/* Notion text colors */
.post-content .text-gray { color: #9b9a97; }
.post-content .text-brown { color: #64473a; }
.post-content .text-orange { color: #d9730d; }
.post-content .text-yellow { color: #cb912f; }
.post-content .text-green { color: #448361; }
.post-content .text-blue { color: #337ea9; }
.post-content .text-purple { color: #9065b0; }
.post-content .text-pink { color: #c14c8a; }
.post-content .text-red { color: #d44c47; }

/* Text background colors */
.post-content .text-gray_background { background-color: rgba(155, 154, 151, 0.15); padding: 2px 4px; border-radius: 3px; }
.post-content .text-brown_background { background-color: rgba(100, 71, 58, 0.15); padding: 2px 4px; border-radius: 3px; }
.post-content .text-orange_background { background-color: rgba(217, 115, 13, 0.15); padding: 2px 4px; border-radius: 3px; }
.post-content .text-yellow_background { background-color: rgba(203, 145, 47, 0.15); padding: 2px 4px; border-radius: 3px; }
.post-content .text-green_background { background-color: rgba(68, 131, 97, 0.15); padding: 2px 4px; border-radius: 3px; }
.post-content .text-blue_background { background-color: rgba(51, 126, 169, 0.15); padding: 2px 4px; border-radius: 3px; }
.post-content .text-purple_background { background-color: rgba(144, 101, 176, 0.15); padding: 2px 4px; border-radius: 3px; }
.post-content .text-pink_background { background-color: rgba(193, 76, 138, 0.15); padding: 2px 4px; border-radius: 3px; }
.post-content .text-red_background { background-color: rgba(212, 76, 71, 0.15); padding: 2px 4px; border-radius: 3px; }

/* Dark mode text colors */
@media (prefers-color-scheme: dark) {
    .post-content .text-gray { color: #979a9b; }
    .post-content .text-brown { color: #937264; }
    .post-content .text-orange { color: #ffa344; }
    .post-content .text-yellow { color: #ffdc49; }
    .post-content .text-green { color: #4dab9a; }
    .post-content .text-blue { color: #529cca; }
    .post-content .text-purple { color: #9a6dd7; }
    .post-content .text-pink { color: #e255a1; }
    .post-content .text-red { color: #ff7369; }
}

/* Mentions */
.post-content .mention {
    padding: 2px 6px;
    background-color: var(--accent-subtle);
    border-radius: 4px;
    font-size: 0.95em;
}

.post-content .mention-date {
    color: var(--text-secondary);
}

.post-content .mention-user {
    color: var(--accent-color);
}

.post-content .mention-page {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-style: dotted;
}

/* Inline equations */
.post-content .inline-equation {
    font-family: 'Times New Roman', serif;
    font-style: italic;
}

.post-footer {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.back-link:hover {
    color: var(--text-primary);
    transform: translateX(-4px);
}

/* Footer */
.footer {
    padding: 48px 0 32px;
    border-top: 1px solid var(--border-color);
    animation: fadeInUp 0.75s cubic-bezier(0.4, 0, 0.2, 1) 0.25s backwards;
}

.social-links {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-decoration: none;
}

.social-link:hover {
    color: var(--accent-hover);
    background-color: var(--accent-subtle);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.copyright {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Page Transitions (View Transitions API) */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.45s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

::view-transition-old(root) {
    animation-name: fade-out;
}

::view-transition-new(root) {
    animation-name: fade-in;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Fallback page transition for non-supporting browsers */
body {
    opacity: 1;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body.page-transitioning {
    opacity: 0;
}

/* Animations - smoother curves and timing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .header {
        padding: 24px 0;
    }

    .hero-title {
        font-size: 28px;
        margin-bottom: 36px;
    }
    
    .hero-text {
        font-size: 16px;
    }

    .nav {
        gap: 16px;
    }

    .nav-link {
        font-size: 13px;
    }

    .hero-text,
    .cta-text {
        font-size: 15px;
    }

    .favorite-link {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background-color: rgba(167, 196, 160, 0.35);
    color: var(--text-primary);
}

::-moz-selection {
    background-color: rgba(167, 196, 160, 0.35);
    color: var(--text-primary);
}

