/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}

body {
    line-height: 1;
}

ol, ul {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Self-hosted fonts (SIL Open Font License) */

/* JetBrains Mono - latin-ext */
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/jetbrains-mono-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* JetBrains Mono - latin */
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/jetbrains-mono-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* JetBrains Mono Bold - latin-ext */
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/jetbrains-mono-700-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* JetBrains Mono Bold - latin */
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/jetbrains-mono-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Space Mono - latin-ext */
@font-face {
    font-family: 'Space Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/space-mono-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Space Mono - latin */
@font-face {
    font-family: 'Space Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/space-mono-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Space Mono Bold - latin-ext */
@font-face {
    font-family: 'Space Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/space-mono-700-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Space Mono Bold - latin */
@font-face {
    font-family: 'Space Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/space-mono-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
    --bg-color: #0a0a0a;
    --text-color: #cccccc;
    --accent-color: #d90429;
    --text-muted: #777;
    --text-dim: #999;
    --code-bg: #222;
    --border-color: #333;
    --post-bg: rgba(20, 20, 20, 0.95);
    --preview-bg: rgba(20, 20, 20, 0.4);
    --preview-bg-hover: rgba(30, 30, 30, 0.7);
    --topbar-bg: rgba(10, 10, 10, 0.95);
    --footer-bg: rgba(5, 5, 5, 0.9);
    --font-main: 'JetBrains Mono', monospace;
    --font-display: 'Space Mono', monospace;
}

[data-theme="light"] {
    --bg-color: #f4f4f4;
    --text-color: #333333;
    --accent-color: #9e0018;
    /* Deeper crimson for light mode */
    --text-muted: #666666;
    --text-dim: #555555;
    --code-bg: #e0e0e0;
    --border-color: #cccccc;
    --post-bg: #ffffff;
    --preview-bg: rgba(255, 255, 255, 0.7);
    --preview-bg-hover: rgba(255, 255, 255, 0.95);
    --topbar-bg: rgba(244, 244, 244, 0.98);
    --footer-bg: rgba(230, 230, 230, 0.95);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg-color: #f4f4f4;
        --text-color: #333333;
        --accent-color: #9e0018;
        /* Deeper crimson for light mode */
        --text-muted: #666666;
        --text-dim: #555555;
        --code-bg: #e0e0e0;
        --border-color: #cccccc;
        --post-bg: #ffffff;
        --preview-bg: rgba(255, 255, 255, 0.7);
        --preview-bg-hover: rgba(255, 255, 255, 0.95);
        --topbar-bg: rgba(244, 244, 244, 0.98);
        --footer-bg: rgba(230, 230, 230, 0.95);
    }
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
}

body {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

body::-webkit-scrollbar {
    display: none;
}

.theme-btn {
    background: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    color: var(--text-color);
    padding: 5px 10px;
    font-family: var(--font-main);
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.theme-btn:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

/* Grid Overlay */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(to right, rgba(60, 60, 60, 0.3) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(60, 60, 60, 0.3) 1px, transparent 1px),
        linear-gradient(45deg, rgba(255, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(135deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(255, 0, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle, rgba(255, 0, 0, 0.3) 1px, transparent 1px);
    background-repeat: repeat, repeat, repeat, repeat, no-repeat, repeat;
    background-position: 0 0, 0 0, 0 0, 0 0, center center, 0 0;
    background-size:
        150px 150px,
        150px 150px,
        60px 60px,
        60px 60px,
        100vw 100vh,
        200px 200px;
    z-index: -1;
    pointer-events: none;
}

/* Decorative Accents */
body::before {
    content: '';
    position: fixed;
    top: 20%;
    right: -100px;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    transform: rotate(45deg);
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    bottom: 10%;
    left: -150px;
    width: 500px;
    height: 500px;
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 50%;
    z-index: -2;
}

/* Decorative SVG Shapes */
.grid-overlay::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 5%;
    width: 300px;
    height: 300px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10,10 L90,10 L50,90 Z' fill='none' stroke='rgba(255, 0, 0, 0.3)' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    transform: rotate(-15deg);
    z-index: -1;
}

.grid-overlay::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 15%;
    width: 400px;
    height: 200px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,90 C50,90 70,10 100,10 C130,10 150,90 200,90' fill='none' stroke='rgba(255, 0, 0, 0.25)' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    transform: rotate(10deg);
    z-index: -1;
}

/* Typography & Layout */
a {
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
    text-shadow: 0 0 8px var(--accent-color);
}

a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

section {
    margin-bottom: 8rem;
    border-left: 1px solid var(--accent-color);
    padding-left: 20px;
}

main > section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-top: 40px;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: -1px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent-color);
}

/* Header */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--topbar-bg);
    border-bottom: 1px solid var(--accent-color);
    padding: 0 40px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.logo:hover {
    color: var(--accent-color);
    text-shadow: 2px 2px 0px rgba(255, 0, 0, 0.3);
}

.top-nav ul {
    display: flex;
    gap: 40px;
}

.top-link {
    font-size: 0.9rem;
    text-transform: uppercase;
    position: relative;
}

.top-link::before {
    content: '>';
    position: absolute;
    left: -15px;
    opacity: 0;
    color: var(--accent-color);
    transition: opacity 0.2s;
}

.top-link:hover::before {
    opacity: 1;
}

/* Contact Section */
.contact-split {
    display: flex;
    flex-wrap: wrap;
    gap: 6rem;
    margin-top: 2rem;
}

.contact-col {
    flex: 1;
    min-width: 200px;
}

.contact-cat {
    font-family: var(--font-main);
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.social-list-small li {
    margin-bottom: 0.8rem;
}

.social-list-small a {
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-color);
    transition: color 0.3s ease, margin-left 0.3s ease;
    display: inline-block;
}

.social-list-small a:hover {
    color: var(--accent-color);
    margin-left: 5px;
}

/* Blog List */
.blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 3rem;
}

.blog-preview {
    position: relative;
    padding: 1.5rem;
    padding-left: 2rem;
    border-left: 2px solid var(--accent-color);
    background: var(--preview-bg);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.blog-preview:hover {
    background: var(--preview-bg-hover);
    transform: translateY(-4px);
    border-left-width: 4px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.blog-preview .post-date {
    display: block;
    font-family: var(--font-main);
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.blog-preview h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.blog-preview h2 a {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.blog-preview h2 a:hover {
    color: var(--accent-color);
    text-shadow: 2px 2px 0px rgba(255, 0, 0, 0.4);
}

.blog-preview h2 a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.blog-preview p {
    font-family: var(--font-main);
    color: var(--text-dim);
    line-height: 1.6;
    max-width: 800px;
}

/* Hero Section */
#hero {
    margin-top: 100px;
    border-left: none;
    padding-left: 0;
}

#blog-list {
    border-left: none;
    padding-left: 0;
}

/* Back Navigation */
.back-nav {
    margin-bottom: 2rem;
}

.back-nav a {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

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

/* Blog Post Headers */
.blog-post h1 {
    font-family: var(--font-display);
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -2px;
}

.blog-post h2 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--text-color);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    border-left: 4px solid var(--accent-color);
    padding-left: 15px;
    letter-spacing: -1px;
}

.blog-post h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--accent-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-post h4 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    border-left: 2px solid var(--accent-color);
    padding-left: 10px;
}

.blog-post h5 {
    font-family: var(--font-main);
    font-size: 1.1rem;
    color: var(--text-color);
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
    text-underline-offset: 4px;
}

/* Post Layout Wrapper */
.post-layout {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* TOC Sidebar */
.toc-sidebar {
    position: absolute;
    left: -260px;
    top: 0;
    width: 220px;
    height: 100%;
}

.toc-sidebar-inner {
    position: sticky;
    top: 100px;
    background: var(--post-bg);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.toc-sidebar .back-nav {
    margin-bottom: 1.5rem;
}

.toc-container {
    border-left: 2px solid var(--border-color);
    padding-left: 1rem;
    font-size: 0.8rem;
    transition: border-color 0.3s ease;
}

.toc-container:hover {
    border-left-color: var(--accent-color);
}

.toc-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.toc-container:hover .toc-title {
    color: var(--accent-color);
}

.toc-container ul {
    list-style: none;
    /* Strip standard bullet points */
    padding-left: 0;
    margin: 0;
}

.toc-container ul ul {
    padding-left: 15px;
    /* Indent nested sub-headers */
    margin-top: 5px;
}

.toc-container li {
    margin-bottom: 10px;
    line-height: 1.4;
}

.toc-container a {
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.toc-container a:hover {
    color: var(--text-color);
    text-shadow: none;
}

/* Blog Post Content */
.blog-post {
    background: var(--post-bg);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.post-meta {
    color: var(--text-muted);
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}

.blog-post p {
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.8;
    max-width: 70ch;
    overflow-wrap: break-word;
    hyphens: auto;
}

.blog-post img {
    max-width: 100%;
    height: auto;
}

.blog-post code {
    background: var(--code-bg);
    padding: 2px 5px;
    color: #ff5555;
    font-family: var(--font-main);
    font-size: 0.9em;
}

.blog-post pre {
    background: var(--code-bg);
    padding: 20px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    margin: 20px 0;
    border-radius: 4px;
}

.blog-post pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.blog-post blockquote {
    border-left: 2px solid var(--accent-color);
    padding-left: 20px;
    color: var(--text-muted);
    margin: 20px 0;
    font-style: italic;
}

.blog-post ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 20px;
}

.blog-post li {
    margin-bottom: 5px;
}

.blog-post a {
    color: var(--accent-color);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

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

/* Hero Typography */
h1 {
    font-family: var(--font-display);
    font-size: 5rem;
    line-height: 1;
    margin: 0;
    font-weight: 700;
    letter-spacing: -2px;
}

.hero-sub {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-top: 30px;
    font-family: var(--font-main);
    letter-spacing: 2px;
}

/* Glitch Effect */
.glitch {
    position: relative;
    display: block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(13px, 9999px, 86px, 0);
    }

    100% {
        clip: rect(76px, 9999px, 17px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(4px, 9999px, 140px, 0);
    }

    100% {
        clip: rect(104px, 9999px, 13px, 0);
    }
}

/* CV Page */
#cv-header {
    margin-bottom: 2rem;
    border-left: none;
}

#cv-header .section-title {
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 0;
}

#cv-header .section-title::after {
    width: 100px;
    background: var(--accent-color);
}

.cv-content {
    background: var(--post-bg);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    max-width: 800px;
    overflow-wrap: break-word;
}

.cv-content section {
    margin-bottom: 2.5rem;
    border-left: none;
    padding-left: 0;
}

.cv-content section:last-child {
    margin-bottom: 0;
}

.cv-content .section-title {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}
.cv-entry {
    margin-bottom: 2rem;
    border-left: 3px solid var(--accent-color);
    padding-left: 15px;
}

.cv-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cv-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.cv-org {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-top: 0.2rem;
    margin-bottom: 0.4rem;
}

.cv-org a {
    color: var(--accent-color);
}

.cv-entry-title {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
    border-left: none;
    padding-left: 0;
}

.cv-details {
    list-style: disc;
    padding-left: 20px;
    margin-top: 0.5rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.cv-details li {
    margin-bottom: 0.3rem;
}

.cv-awards {
    list-style: none;
    padding-left: 0;
}

.cv-awards li {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.cv-awards li strong {
    color: var(--text-color);
}

.cv-awards .cv-details {
    margin-top: 0.3rem;
    margin-bottom: 0;
}

.cv-awards .cv-details li {
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

/* Ticker */
.ticker-section {
    overflow: hidden;
    border-left: none;
    border-bottom: 1px solid var(--border-color);
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: 0;
    padding-left: 0;
    position: relative;
    z-index: 11;
}

.ticker-wrap {
    overflow: hidden;
    flex: 1;
}

.ticker-move {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: ticker-scroll 30s linear infinite;
    width: max-content;
    will-change: transform;
}

.ticker-item a {
    font-family: var(--font-main);
    font-size: 0.65rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0;
    display: inline-block;
}

.ticker-item a:hover {
    color: var(--accent-color);
    text-shadow: none;
}

.ticker-sep {
    color: var(--accent-color);
    padding: 0 0.8rem;
    font-size: 0.35rem;
    line-height: 1;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-16.667%); }
}

/* Ticker Detail (CSS-only :target reveal) */
.ticker-detail {
    display: none;
    margin-left: -20px;
    margin-right: -20px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--border-color);
}

.ticker-detail:target {
    display: block;
}

.ticker-detail p {
    opacity: 1;
}

.ticker-detail-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: default;
}

.ticker-detail-backdrop:hover {
    text-shadow: none;
}

.ticker-detail-body {
    position: relative;
    z-index: 11;
    text-align: center;
}

.ticker-detail-head {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-color);
    margin-bottom: 2px;
}

.ticker-detail-links {
    font-family: var(--font-main);
    font-weight: 400;
    font-size: 0.6rem;
    text-transform: none;
}

.ticker-detail-links a {
    color: var(--accent-color);
    font-size: 0.6rem;
}

.ticker-detail-desc {
    font-size: 0.75rem;
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: 1px;
}

.ticker-detail-punch {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Radar Page */
#radar-header {
    margin-bottom: 2rem;
    border-left: none;
}

#radar-header .section-title {
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 0;
}

#radar-header .section-title::after {
    width: 100px;
    background: var(--accent-color);
}

.radar-content {
    background: var(--post-bg);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    max-width: 800px;
    overflow-wrap: break-word;
}

.radar-content > p {
    color: var(--text-dim);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.radar-content > p a {
    color: var(--accent-color);
}

.radar-entry {
    margin-bottom: 2rem;
    border-left: 3px solid var(--accent-color);
    padding-left: 15px;
}

.radar-entry:last-child {
    margin-bottom: 0;
}

.radar-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.radar-entry-title {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
    border-left: none;
    padding-left: 0;
}

.radar-entry-title a {
    color: var(--text-color);
    transition: color 0.2s;
}

.radar-entry-title a:hover {
    color: var(--accent-color);
}

.radar-category {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0.3rem 0;
    opacity: 0.8;
}

.radar-entry p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 0.4rem;
}

footer {
    border-top: 1px solid var(--border-color);
    padding: 0 20px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    background: var(--footer-bg);
    margin-top: auto;
}

footer p {
    margin-top: 15px;
}

footer p {
    opacity: 0.7;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .glitch::before,
    .glitch::after {
        animation: none;
    }

    .ticker-move {
        animation: none;
    }

    body {
        scroll-behavior: auto;
    }
}

/* Stack TOC below 1400px so it doesn't clip off left edge */
@media (max-width: 1400px) {
    .post-layout {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .toc-sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .toc-sidebar-inner {
        position: static;
        opacity: 1;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        padding: 10px 15px 15px;
        gap: 8px;
        height: auto;
    }

    .logo {
        font-size: 1rem;
    }

    .top-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 8px;
        justify-content: center;
    }

    .top-link {
        font-size: 0.75rem;
        display: inline-block;
        padding: 10px 8px;
    }

    .top-link::before {
        display: none;
    }

    .theme-btn {
        min-height: 44px;
        min-width: 44px;
    }

    h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin-top: 30px;
    }

    main {
        padding-top: 90px;
        padding-left: 15px;
        padding-right: 15px;
    }

    section {
        margin-bottom: 5rem;
    }

    .blog-list {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-split {
        flex-direction: column;
        gap: 2rem;
    }

    .glitch {
        max-width: 100%;
        overflow: hidden;
    }

    .glitch::before,
    .glitch::after {
        max-width: 100%;
    }

    .grid-overlay::before {
        width: 120px;
        height: 120px;
    }

    .grid-overlay::after {
        width: 160px;
        height: 80px;
    }

    footer {
        padding: 0 15px 15px;
        font-size: 0.7rem;
    }

    footer a {
        display: inline-block;
        padding: 6px 4px;
    }

    .blog-post {
        padding: 25px 15px;
    }

    .blog-post h1 {
        font-size: 1.8rem;
        letter-spacing: -1px;
    }

    .blog-post h2 {
        font-size: 1.4rem;
        padding-left: 10px;
    }

    .blog-post h3 {
        font-size: 1.2rem;
    }

    .blog-post p {
        font-size: 0.95rem;
    }

    .blog-post pre {
        padding: 10px;
        font-size: 0.8rem;
    }

    .cv-entry-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cv-details {
        font-size: 0.85rem;
        padding-left: 16px;
    }

    .cv-awards li {
        font-size: 0.85rem;
    }

    .cv-content {
        padding: 25px 15px;
    }

    #cv-header .section-title {
        font-size: 2rem;
    }

    .ticker-section {
        margin-left: -15px;
        margin-right: -15px;
    }

    .ticker-item a {
        font-size: 0.65rem;
        padding: 4px 0;
    }

    .ticker-sep {
        padding: 0 0.6rem;
    }

    .radar-content {
        padding: 25px 15px;
    }

    #radar-header .section-title {
        font-size: 2rem;
    }

    .radar-entry-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .ticker-detail {
        padding: 10px 15px;
        margin-left: -15px;
        margin-right: -15px;
    }

    .ticker-detail-head {
        font-size: 0.75rem;
    }

    .ticker-detail-links,
    .ticker-detail-links a {
        font-size: 0.65rem;
    }

    .ticker-detail-links a {
        display: inline-block;
        padding: 6px 4px;
    }

    .ticker-detail-desc {
        font-size: 0.75rem;
    }

    .ticker-detail-punch {
        font-size: 0.7rem;
    }
}

/* Pygments / codehilite syntax highlighting - dark theme with red accents */
.codehilite { background: #111; padding: 20px; overflow-x: auto; border: 1px solid var(--border-color); margin: 20px 0; }
.codehilite pre { margin: 0; background: none; border: none; padding: 0; }

/* Comments */
.codehilite .c, .codehilite .c1, .codehilite .cm, .codehilite .cs, .codehilite .cp { color: #555; font-style: italic; }

/* Keywords */
.codehilite .k, .codehilite .kc, .codehilite .kd, .codehilite .kn, .codehilite .kp, .codehilite .kr, .codehilite .kt { color: #ff5555; }

/* Strings */
.codehilite .s, .codehilite .s1, .codehilite .s2, .codehilite .sb, .codehilite .sc, .codehilite .sd, .codehilite .se, .codehilite .sh, .codehilite .si, .codehilite .sx, .codehilite .sr, .codehilite .ss { color: #e6db74; }

/* Numbers */
.codehilite .m, .codehilite .mi, .codehilite .mf, .codehilite .mh, .codehilite .mo, .codehilite .mb, .codehilite .il { color: #ae81ff; }

/* Names / Functions */
.codehilite .n { color: #e0e0e0; }
.codehilite .na { color: #a6e22e; }
.codehilite .nb { color: #e0e0e0; }
.codehilite .nc { color: #ff5555; font-weight: bold; }
.codehilite .nf, .codehilite .fm { color: #a6e22e; }
.codehilite .nd { color: #ff5555; }
.codehilite .ni { color: #e0e0e0; }
.codehilite .nn { color: #e0e0e0; }
.codehilite .nt { color: #ff5555; }
.codehilite .nv, .codehilite .vi, .codehilite .vs { color: #e0e0e0; }

/* Operators */
.codehilite .o, .codehilite .ow { color: #ff5555; }

/* Punctuation */
.codehilite .p { color: #e0e0e0; }

/* Built-in / Decorator */
.codehilite .bp { color: #e0e0e0; }

/* Generic (diff, errors, etc.) */
.codehilite .gd { color: #ff5555; }
.codehilite .gi { color: #a6e22e; }
.codehilite .ge { font-style: italic; }
.codehilite .gs { font-weight: bold; }
.codehilite .gh { color: #e0e0e0; font-weight: bold; }
.codehilite .gu { color: #555; }
.codehilite .go { color: #888; }
.codehilite .err { color: #e0e0e0; }

/* Line numbers */
.codehilite .ln, .codehilite .linenodiv { color: #555; }
