:root {
    --accent: #FF6B35;
    --accent-light: #FF8C00;
    --text-primary: #EDE7F4;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --text-dim: #666666;
    --bg: #0a0a0a;

    --accent-70: rgba(255, 107, 53, 0.7);
    --accent-60: rgba(255, 107, 53, 0.6);
    --accent-40: rgba(255, 107, 53, 0.4);
    --accent-20: rgba(255, 107, 53, 0.2);
    --accent-10: rgba(255, 107, 53, 0.1);

    --warm-bg: rgba(42, 24, 16, 0.3);
    --warm-bg-hover: rgba(42, 24, 16, 0.5);
    --card-bg: rgba(20, 20, 20, 0.4);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.08);

    --glow-sm: 0 0 12px rgba(255, 107, 53, 0.15);
    --glow-lg: 0 0 25px rgba(255, 107, 53, 0.15), 0 6px 16px rgba(0, 0, 0, 0.3);

    --logo-grad: linear-gradient(90deg, #8B7355, #A0826D, #FF6B35);
    --separator-mid: rgba(255, 107, 53, 0.8);
    --separator-edge: rgba(255, 107, 53, 0.45);
    --tag-bg: #2a1810;
    --toc-muted: #555555;
    --dot-color: #333333;
}

[data-theme="light"] {
    --accent: #7C3AED;
    --accent-light: #6D28D9;
    --text-primary: #1a1a2e;
    --text-secondary: #333344;
    --text-muted: #666677;
    --text-dim: #999aaa;
    --bg: #f0f0f6;

    --accent-70: rgba(124, 58, 237, 0.7);
    --accent-60: rgba(124, 58, 237, 0.6);
    --accent-40: rgba(124, 58, 237, 0.4);
    --accent-20: rgba(124, 58, 237, 0.2);
    --accent-10: rgba(124, 58, 237, 0.1);

    --warm-bg: rgba(124, 58, 237, 0.06);
    --warm-bg-hover: rgba(124, 58, 237, 0.18);
    --card-bg: rgba(124, 58, 237, 0.04);
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-light: rgba(0, 0, 0, 0.1);

    --glow-sm: 0 0 12px rgba(124, 58, 237, 0.2);
    --glow-lg: 0 0 25px rgba(124, 58, 237, 0.15), 0 6px 16px rgba(0, 0, 0, 0.08);

    --logo-grad: linear-gradient(90deg, #6D28D9, #8B5CF6, #7C3AED);
    --separator-mid: rgba(124, 58, 237, 0.7);
    --separator-edge: rgba(124, 58, 237, 0.45);
    --tag-bg: rgba(124, 58, 237, 0.1);
    --toc-muted: #999aaa;
    --dot-color: #b8b8cc;
}

/* ===================== */
/* Reset and base        */
/* ===================== */

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

html {
    scroll-behavior: smooth;
}

/* Reading progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--accent);
    z-index: 1000;
    transition: width 0.1s linear;
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ===================== */
/* Theme toggle          */
/* ===================== */

.theme-toggle {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--accent-10);
    box-shadow: var(--glow-sm);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

/* Dark mode (default): show moon, hide sun */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* Light mode: show sun, hide moon */
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 100;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, color 0.2s ease, border-color 0.2s ease;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

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

/* ===================== */
/* Dot grid background   */
/* ===================== */

#dotGrid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===================== */
/* Header                */
/* ===================== */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 700px;
    margin: 0 auto 30px;
    position: relative;
    z-index: 2;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--logo-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

a.logo {
    text-decoration: none;
}

/* ===================== */
/* Navigation            */
/* ===================== */

.header-nav a,
.footer-nav a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.header-nav a {
    margin-left: 20px;
}

.footer-nav a {
    margin-right: 20px;
}

.header-nav a:hover,
.footer-nav a:hover {
    background: var(--accent-10);
    box-shadow: var(--glow-sm);
}

/* ===================== */
/* Separator             */
/* ===================== */

@keyframes sheen {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.separator {
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--separator-edge) 0%,
        var(--separator-edge) 40%,
        var(--separator-mid) 50%,
        var(--separator-edge) 60%,
        var(--separator-edge) 100%
    );
    background-size: 200% 100%;
    margin: 28px 0;
    animation: sheen 5s linear infinite;
    position: relative;
    z-index: 2;
    will-change: background-position;
}

/* ===================== */
/* Main content          */
/* ===================== */

main {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    animation: fadeIn 0.4s ease;
}

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

/* ===================== */
/* Footer                */
/* ===================== */

footer {
    max-width: 700px;
    margin: 40px auto 0;
    position: relative;
    z-index: 2;
}

footer .separator {
    margin: 0 0 20px;
}

.footer-nav {
    text-align: center;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 10px;
    padding-bottom: 40px;
}

.social-icons a {
    color: var(--accent);
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.social-icons a:hover {
    background: var(--accent-10);
    box-shadow: var(--glow-sm);
}

.social-icons svg {
    width: 20px;
    height: 20px;
}

/* ===================== */
/* Hero section          */
/* ===================== */

.hero-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.profile-pic {
    width: 123px;
    height: 123px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--accent-40);
    box-shadow: 0 0 20px var(--accent-40),
                0 2px 8px rgba(0, 0, 0, 0.3);
}

h2 {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 0;
    white-space: nowrap;
}

/* Intro paragraph with sheen */
.intro {
    font-size: 1.35rem;
    margin-bottom: 4px;
    margin-top: 0;
    color: var(--text-secondary);
}

.intro em {
    font-style: normal;
    color: var(--accent);
}

.bio-section {
    margin: 28px 0 8px;
}

.bio {
    font-size: 1.08rem;
    line-height: 1.9;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.bio em {
    font-style: italic;
    color: var(--accent);
}

.bio a {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--accent-40);
    transition: text-decoration-color 0.2s ease;
}

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

/* ===================== */
/* Page titles           */
/* ===================== */

.page-title,
.hero-section h2 {
    font-size: 3.6rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(
        120deg,
        var(--accent) 0%,
        var(--accent) 30%,
        var(--accent-light) 45%,
        var(--accent-70) 55%,
        var(--accent) 70%,
        var(--accent) 100%
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: sheen 5s linear infinite;
    filter: drop-shadow(2px 4px 0 var(--accent-40))
           drop-shadow(4px 8px 0 var(--accent-20))
           drop-shadow(0 6px 24px var(--accent-40));
}

.hero-section h2 {
    font-size: clamp(3rem, 6.5vw, 4.2rem);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    visibility: hidden;
}

/* ===================== */
/* Post cards            */
/* ===================== */

.recent-posts,
.blog-posts {
    margin-bottom: 0;
}

#all-posts-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.post-entry {
    margin-bottom: 0;
}

.post-link {
    text-decoration: none;
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    margin: -12px -16px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.post-link:hover {
    background: var(--accent-10);
    box-shadow: var(--glow-sm);
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.post-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.post-summary {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

/* ===================== */
/* Tags (unified)        */
/* ===================== */

.tag-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.tag-filter {
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-light);
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.tag-filter:hover {
    color: var(--accent-light);
    border-color: var(--accent-20);
    background: var(--tag-bg);
}

.tag-filter.active {
    color: var(--accent-light);
    border-color: var(--accent-40);
    background: var(--tag-bg);
}

.post-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.post-tag,
.book-category {
    font-size: 0.75rem;
    color: var(--accent-light);
    background-color: var(--tag-bg);
    padding: 4px 10px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ===================== */
/* Home page post rows   */
/* ===================== */

.post-link-row {
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 0 -16px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.post-link-row:hover {
    background: var(--accent-10);
    box-shadow: var(--glow-sm);
}

.post-row-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.post-row-line {
    flex: 1;
    height: 0;
    border-top: 3px solid;
    border-image: linear-gradient(90deg, var(--accent-70), var(--accent-40)) 1;
}

.post-row-date {
    font-size: 1.1rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.all-posts-link {
    margin-top: 30px;
}

.all-posts-link a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.all-posts-link a:hover {
    background: var(--accent-10);
    box-shadow: var(--glow-sm);
}

.section-heading {
    font-size: 0.95rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===================== */
/* Projects              */
/* ===================== */

.projects-section {
    display: flex;
    flex-direction: column;
    gap: 35px;
    margin-bottom: 0;
}

#projects-list {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.project-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0;
    background-color: var(--warm-bg);
    border-radius: 4px;
    border: 1px solid var(--accent-40);
    transition: all 0.3s ease;
    overflow: hidden;
}

.project-card:hover {
    border-color: var(--accent-70);
    background-color: var(--warm-bg-hover);
    box-shadow: var(--glow-lg);
    transform: translateY(-2px);
}

.project-card:hover .project-card-title {
    color: var(--accent);
}

.project-card-body {
    padding: 25px;
}

.project-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.project-card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.project-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.project-card-summary {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.project-card-details {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
}

.project-card-details li {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 4px 0 4px 16px;
    position: relative;
}

.project-card-details li::before {
    content: "\2022";
    color: var(--accent);
    position: absolute;
    left: 0;
}

/* ===================== */
/* Disclaimer            */
/* ===================== */

.disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 24px;
    background-color: var(--warm-bg);
    border-radius: 4px;
    border: 1px solid var(--accent-40);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.disclaimer:hover {
    border-color: var(--accent-70);
    background-color: var(--warm-bg-hover);
    box-shadow: var(--glow-lg);
    transform: translateY(-2px);
}

.disclaimer-icon {
    flex-shrink: 0;
    width: 1.1em;
    height: 1.1em;
    margin-top: 2px;
    color: var(--accent);
}

.disclaimer p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

/* ===================== */
/* Space patrol          */
/* ===================== */

.space-patrol {
    margin: 10px 0 0;
    visibility: hidden;
}

.space-patrol.sp-ready {
    visibility: visible;
}

.space-patrol .disclaimer {
    margin-bottom: 0;
}

/* ===================== */
/* Bookshelf             */
/* ===================== */

.reading-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 36px;
    gap: 20px;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 20px;
    background-color: var(--warm-bg);
    border-radius: 4px;
    border: 1px solid var(--accent-40);
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: var(--accent-70);
    background-color: var(--warm-bg-hover);
    box-shadow: var(--glow-lg);
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.books-section {
    margin-bottom: 60px;
}

.reading-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.reading-indicator.active {
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-60);
    animation: pulse-indicator 2s ease-in-out infinite;
}

.reading-indicator.queue {
    background-color: var(--accent);
    opacity: 0.4;
    animation: pulse-queue 3s ease-in-out infinite;
}

.reading-indicator.completed {
    background-color: var(--text-dim);
}

@keyframes pulse-queue {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes pulse-indicator {
    0%, 100% { box-shadow: 0 0 10px var(--accent-60); }
    50% { box-shadow: 0 0 20px var(--accent-70); }
}

.book-card {
    margin-bottom: 35px;
    padding: 25px;
    background-color: var(--warm-bg);
    border-radius: 4px;
    border: 1px solid var(--accent-40);
    transition: all 0.3s ease;
}

.book-card:hover {
    border-color: var(--accent-70);
    background-color: var(--warm-bg-hover);
    box-shadow: var(--glow-lg);
    transform: translateY(-2px);
}

.book-info { width: 100%; }

.book-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.book-author {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-style: italic;
}

.book-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.book-note {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

.book-list-compact {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.compact-book {
    padding: 15px;
    background-color: var(--warm-bg);
    border-radius: 4px;
    border-left: 3px solid var(--accent-40);
    transition: all 0.3s ease;
}

.compact-book:hover {
    border-left-color: var(--accent-70);
    background-color: var(--warm-bg-hover);
    box-shadow: var(--glow-lg);
    transform: translateY(-2px);
}

.compact-title {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.compact-author {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-left: 8px;
}

/* ===================== */
/* Trailing o's          */
/* ===================== */

.o {
    display: inline-block;
    animation: wave 3s ease-in-out infinite;
    background: inherit;
    background-size: inherit;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.o1 { animation-delay: 0s; }
.o2 { animation-delay: 0.1s; }
.o3 { animation-delay: 0.2s; }
.o4 { animation-delay: 0.3s; }
.o5 { animation-delay: 0.4s; }
.o6 { animation-delay: 0.5s; }
.o7 { animation-delay: 0.6s; }
.o8 { animation-delay: 0.7s; }
.o9 { animation-delay: 0.8s; }
.o10 { animation-delay: 0.9s; }
.o11 { animation-delay: 1.0s; }
.o12 { animation-delay: 1.1s; }
.o13 { animation-delay: 1.2s; }
.o14 { animation-delay: 1.3s; }
.o15 { animation-delay: 1.4s; }
.o16 { animation-delay: 1.5s; }
.o17 { animation-delay: 1.6s; }
.o18 { animation-delay: 1.7s; }
.o19 { animation-delay: 1.8s; }
.o20 { animation-delay: 1.9s; }
.o21 { animation-delay: 2.0s; }
.o22 { animation-delay: 2.1s; }
.o23 { animation-delay: 2.2s; }

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.o1 { font-size: 1em; }
.o2 { font-size: 0.98em; }
.o3 { font-size: 0.95em; }
.o4 { font-size: 0.92em; }
.o5 { font-size: 0.88em; }
.o6 { font-size: 0.84em; }
.o7 { font-size: 0.80em; }
.o8 { font-size: 0.75em; }
.o9 { font-size: 0.70em; }
.o10 { font-size: 0.65em; }
.o11 { font-size: 0.60em; }
.o12 { font-size: 0.55em; }
.o13 { font-size: 0.50em; }
.o14 { font-size: 0.46em; }
.o15 { font-size: 0.42em; }
.o16 { font-size: 0.38em; }
.o17 { font-size: 0.34em; }
.o18 { font-size: 0.30em; }
.o19 { font-size: 0.26em; }
.o20 { font-size: 0.22em; }
.o21 { font-size: 0.18em; }
.o22 { font-size: 0.14em; }
.o23 { font-size: 0.10em; }

/* ===================== */
/* Blog post pages       */
/* ===================== */

.post {
    margin-bottom: 40px;
}

.post-back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 30px;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.post-back-link:hover {
    background: var(--accent-10);
    box-shadow: var(--glow-sm);
}

.post-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.post-page-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 40px;
}

/* Post layout with TOC sidebar */
.post-layout {
    position: relative;
}

.post-body {
    max-width: 100%;
}

.post-toc {
    position: sticky;
    top: 40px;
    float: left;
    width: 180px;
    margin-left: -230px;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 8px;
}

.post-toc a {
    font-size: 0.8rem;
    color: var(--toc-muted);
    text-decoration: none;
    padding: 6px 0 6px 14px;
    border-left: 1px solid var(--border-subtle);
    transition: color 0.25s ease, border-color 0.25s ease;
    line-height: 1.4;
}

.post-toc a:hover,
.post-toc a.active {
    color: var(--text-secondary);
    border-left-color: var(--accent);
}

@media (max-width: 1100px) {
    .post-toc {
        display: none;
    }
}

.post-body p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.post-body > :last-child {
    margin-bottom: 0;
}

.post-body h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 40px;
    margin-bottom: 16px;
}

.post-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.post-body em {
    font-style: italic;
    color: var(--text-secondary);
}

/* Inline code */
.post-body code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    background-color: var(--border-subtle);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--accent-light);
}

/* Code blocks */
.post-body pre {
    background-color: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.post-body pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Blockquotes */
.post-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    margin: 24px 0;
}

.post-body blockquote p {
    color: var(--text-muted);
    font-style: italic;
    font-size: 1rem;
}

/* Lists */
.post-body ul,
.post-body ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.post-body li {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 8px;
}

.post-body ul li::marker {
    color: var(--accent);
}

.post-body ol li::marker {
    color: var(--accent);
    font-weight: 600;
}

/* Tables */
.post-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.post-table th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--accent-40);
    background-color: var(--warm-bg);
}

.post-table td {
    padding: 10px 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

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

/* Figures / Images */
.post-figure {
    margin: 30px 0;
}

.post-figure img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.post-figure figcaption {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
    text-align: center;
    font-style: italic;
}

/* Inline links */
.post-link-inline {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-20);
    transition: border-color 0.3s ease;
}

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

/* Post divider */
.post-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 40px 0 24px;
}

/* Post navigation (prev/next) */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.post-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
    max-width: 45%;
}

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

.post-nav .post-nav-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    color: var(--text-dim);
}

.post-nav .post-nav-next {
    text-align: right;
    margin-left: auto;
}

/* ===================== */
/* 404 page              */

.four-oh-four {
    text-align: center;
    padding-top: 60px;
}

.four-oh-four .page-title {
    font-size: 7rem;
    font-weight: 900;
    letter-spacing: -2px;
    filter: drop-shadow(2px 4px 0 var(--accent-40))
           drop-shadow(4px 8px 0 var(--accent-20))
           drop-shadow(0 6px 24px var(--accent-40));
}


.four-oh-four .disclaimer {
    display: inline-flex;
    text-align: left;
}

.four-oh-four-link {
    margin-top: 32px;
}

.four-oh-four-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.four-oh-four-link a:hover {
    color: var(--accent);
}

/* Responsive            */
/* ===================== */

@media (max-width: 480px) {
    .post-page-title {
        font-size: 1.5rem;
    }
    .post-body pre {
        padding: 14px;
        font-size: 0.8rem;
    }
    .post-table {
        font-size: 0.8rem;
    }
    .post-table th,
    .post-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 768px) {
    h2 { font-size: 2rem; }

    .profile-pic {
        width: 75px;
        height: 75px;
    }

    .o10, .o11, .o12, .o13, .o14, .o15, .o16, .o17,
    .o18, .o19, .o20, .o21, .o22, .o23 {
        display: none;
    }

    .hero-section h2 {
        background: none;
        -webkit-background-clip: unset;
        background-clip: unset;
        -webkit-text-fill-color: var(--accent);
        animation: none;
    }

    .o {
        background: none;
        -webkit-background-clip: unset;
        background-clip: unset;
        -webkit-text-fill-color: var(--accent);
        filter: drop-shadow(2px 4px 0 var(--accent-40))
               drop-shadow(4px 8px 0 var(--accent-20))
               drop-shadow(0 6px 24px var(--accent-40));
    }

    body {
        padding: 20px 20px;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
    }

    main {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* --- nav group --- */
    header {
        margin-bottom: 24px;
        flex-shrink: 0;
    }

    .logo {
        font-size: 1.15rem;
        flex-shrink: 0;
    }

    .header-nav a {
        margin-left: 8px;
        font-size: 0.78rem;
        padding: 4px 6px;
    }

    .header-right {
        gap: 6px;
    }

    .theme-toggle {
        width: 30px;
        height: 30px;
    }

    /* --- hero + intro group --- */
    .hero-section {
        max-width: 100%;
    }
    .hero-section {
        margin-bottom: 10px;
    }

    .intro {
        font-size: 1.05rem;
    }

    /* --- between groups --- */
    .separator {
        margin: 28px 0;
    }

    /* --- recent writing group --- */
    .section-heading {
        margin-bottom: 10px;
    }

    .post-link-row {
        padding: 8px 10px;
        margin: 0 -10px;
        gap: 10px;
    }

    .all-posts-link {
        margin-top: 10px;
    }

    /* --- footer group --- */
    footer {
        margin-top: 16px;
        flex-shrink: 0;
        width: 100%;
    }

    .footer-nav a {
        margin-right: 12px;
        font-size: 0.85rem;
    }

    .page-title { font-size: 2.4rem; }

    .project-card-body { padding: 20px; }
    .reading-stats { flex-direction: column; }
    .stat-number { font-size: 2rem; }
    .book-card { padding: 20px; }
}
