:root {
    --dynamic-bg-color: transparent;
}

html {
    font-size: 14px;
    line-height: 1.5rem;
    font-family: sans-serif;
    -webkit-text-size-adjust: 100%;
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

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

*,
::after,
::before {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    background: #eee;
    min-height: 100vh;
    line-height: 1.5rem;
    font-family: 'Univers LT Pro', -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-weight: 400;
    color: #000;
    text-rendering: optimizeLegibility;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

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

/* Background 3D canvas for the dither effect */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    display: block;
}

a {
    cursor: pointer;
    text-decoration: underline;
    color: #002dce;
    outline: 0;
    background-color: transparent;
    -webkit-text-decoration-skip: objects;
}

a:active,
a:hover {
    outline-width: 0;
    text-decoration: none;
    color: #002dce;
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    user-select: none;
}

a:focus {
    text-decoration: none;
    color: #002dce;
}

.main-container {
    position: relative;
    z-index: 1;
    max-width: 60rem;
    margin: 2rem auto;
    background-color: #fff;
    padding: 0rem 2rem;
    box-shadow: 2px 2px #ccc;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
    border: 1px solid #888;
}

.black {
    color: #000 !important;
    fill: #000 !important;
}

.bg-white {
    background: #fff !important;
}

.w100 {
    width: 100% !important;
}

hr {
    overflow: visible;
    box-sizing: content-box;
    height: 0;
    border: none;
    border-top: 1px dashed #000;
    margin: .5rem 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Univers LT Pro', -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: .5em;
    color: inherit;
}

hr.solid-header {
    border: none;
    display: block;
    width: 100%;
}

.bdp-gray {
    background: radial-gradient(#777 .5px, transparent 1px) 0 0/3px 3px, var(--dynamic-bg-color);
}

.mh1 {
    height: 1rem;
    max-height: 1rem;
    margin-left: .25rem;
    margin-right: .25rem;
}

.mb0 { margin-bottom: 0 !important; }
.mb2 { margin-bottom: .5rem; }
.mb3 { margin-bottom: 1rem; }
.mb4 { margin-bottom: 2rem; }

/* Footer & Grid System */
.columns {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.4rem;
    width: 100%;
}

.column {
    padding: 0 0.4rem;
    flex: 0 0 auto;
}

.col-12 { width: 100%; }
.col-9 { width: 75%; }
.col-6 { width: 50%; }
.col-3 { width: 25%; }

.align-right { text-align: right; }

.silver {
    color: #999 !important;
    fill: #999 !important;
}

.text-condensed { font-stretch: condensed; }
.text-uppercase { text-transform: uppercase; }

.no-decoration {
    text-decoration: none !important;
}

.bt {
    border-top: 1px solid;
}

.b--moon-gray {
    border-color: #ccc;
}

.sku {
    display: inline-block;
    font-family: TX-02-Data, 'Roboto Mono', Menlo, Courier, monospace;
    font-size: 0.7rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.2rem;
    padding: 1px .2rem 1px .3rem;
    letter-spacing: .1rem;
    text-transform: uppercase;
    border: 1px dotted #000;
    vertical-align: middle;
    user-select: none;
    -webkit-user-select: none;
}

.bg-light-pink { background: #fce4ec !important; }
.bg-light-blue { background: #e1f5fe !important; }
.bg-light-green { background: #e8f5e9 !important; }
.bg-light-gray { background: #f5f5f5 !important; }
.bg-light-yellow { background: #fff5b1 !important; }
.bg-light-orange { background: #fff3e0 !important; }
.bg-light-purple { background: #f3e5f5 !important; }

.white { color: #fff; }

footer {
    margin-top: 4rem;
    width: 100%;
    color: #000;
    padding-bottom: 2rem;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

small {
    font-size: 80%;
    font-weight: 400;
}

.nav-container {
    width: 100%;
    margin: 0 auto 1rem auto;
}

.nav-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.nav-container li {
    flex: 1;
    min-width: 7rem;
}

.btn-nav {
    font-family: 'Univers LT Pro', -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto;
    font-weight: 400;
    font-style: normal;
    font-stretch: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.7rem;
    margin-right: .5rem;
    padding: 0;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
    border: .1rem solid #000;
    outline: 0;
    box-shadow: 2px 2px #bbb;
    -webkit-appearance: none;
    appearance: none;
}

.btn-nav:focus,
.btn-nav:hover,
.btn-nav.active {
    text-decoration: none;
    color: #fff !important;
    border-color: #000;
    background: #000 !important;
    fill: #fff;
}

.btn-nav.active {
    box-shadow: none;
    transform: translate(1px, 1px);
}

#site-title {
    font-family: 'Microgramma D Extended', 'Univers LT Pro', sans-serif;
    font-weight: 700;
    line-height: 1.1;
    padding: 0;
    font-size: clamp(1.5rem, 5vw, 2.7rem);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    text-align: center;
    z-index: 10;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    color: #1a1a1a;
}

.header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0 1rem 0;
    width: 100%;
}

.about-section,
.releases-section,
.project-section {
    width: 100%;
    margin: 0 auto 1rem auto;
    text-align: left;
}

.about-section p,
.releases-section p,
.project-section p {
    margin-bottom: 1rem;
    line-height: 1.5rem;
    font-size: 0.9rem;
}

.project-section ul,
.project-section ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.project-section li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Table styles */
.table {
    font-size: 1rem;
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    text-align: left;
    border-top: 2px dotted #ddd;
    box-shadow: 2px 2px #ddd;
}

.table-light-silver {
    border-left: 4px solid #aaa;
}

.table td {
    line-height: 1.4rem;
    overflow: hidden;
    padding: .3rem .4rem;
    text-overflow: ellipsis;
    border: .1rem solid #bfbfbf;
}

.table th {
    font-family: 'Univers LT Pro', -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto;
    font-weight: 700;
    line-height: 1.2rem;
    height: 1.85rem;
    padding: .2rem .4rem 0;
    border-right: .1rem solid #bfbfbf;
    border-bottom: .1rem solid #000;
    text-align: left;
}

.table td.rowfit {
    width: 1%;
    white-space: nowrap;
}

/* Project Tiles Grid */
.project-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
}

.project-tile {
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
    background: #fff;
    transition: transform 0.15s, box-shadow 0.15s;
    overflow: hidden;
}

.project-tile:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px #aaa;
}

.project-tile a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-tile .tile-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #000;
}

.project-tile .tile-info {
    padding: 0.6rem 0.8rem;
}

.project-tile .tile-info h3 {
    font-size: 0.9rem;
    margin-bottom: 0.3em;
}

.project-tile .tile-info p {
    font-size: 0.75rem;
    color: #555;
    margin: 0;
    line-height: 1.3;
}

.project-tile .tile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0 0.8rem 0.6rem 0.8rem;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.filter-tab {
    font-family: TX-02-Data, 'Roboto Mono', Menlo, Courier, monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    border: 1px dotted #000;
    padding: 2px 0.5rem;
    background: #fff;
    color: #000;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.filter-tab:hover,
.filter-tab.active {
    background: #000;
    color: #fff;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
}

.skill-category {
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
    padding: 0.8rem;
}

.skill-category h3 {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px dashed #000;
}

.skill-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-category li {
    font-size: 0.8rem;
    padding: 0.15rem 0;
    line-height: 1.4;
}

/* Hero CTA buttons */
.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 2rem 0;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 1.7rem;
    padding: 0 1rem;
    text-decoration: none;
    border: .1rem solid #000;
    box-shadow: 2px 2px #bbb;
    font-family: 'Univers LT Pro', -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto;
    font-weight: 400;
    font-size: 0.85rem;
    color: #000;
    background: #fff;
    transition: background 0.15s, color 0.15s;
}

.btn-hero:hover {
    background: #000;
    color: #fff;
}

/* Project page specific */
.project-hero-img {
    width: 100%;
    max-width: 70%;
    display: block;
    margin: 1rem auto;
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
}

.project-hero-img.full {
    max-width: 100%;
}

.project-media-row {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.project-media-row figure {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

.project-media-row img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
}

.project-media-row figcaption {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.3rem;
    font-style: italic;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.project-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1.5rem 0;
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* PDF embed */
.pdf-embed {
    width: 100%;
    height: 600px;
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
    margin: 1rem 0;
}

/* Tech Stack Tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0;
}

.tech-tag {
    display: inline-block;
    font-family: TX-02-Data, 'Roboto Mono', Menlo, Courier, monospace;
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.2rem;
    padding: 1px .3rem;
    letter-spacing: .05rem;
    text-transform: uppercase;
    border: 1px dotted #000;
    background: #f5f5f5;
}

/* Blog Posts */
.blog-post {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed #ccc;
}

.blog-post:last-child {
    border-bottom: none;
}

.blog-post-title {
    font-size: 1.1rem;
    margin-bottom: 0.3em;
}



.blog-post-link {
    color: inherit;
    text-decoration: none;
}

.blog-post-link:hover {
    color: inherit;
    text-decoration: none;
}

.blog-post-link:hover .blog-post-arrow {
    color: #000;
}

.blog-post-arrow {
    font-size: 0.8em;
    color: #999;
    transition: color 0.15s;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: #999;
}

.post-hero-figure {
    margin: 0 0 1.5rem 0;
}

.post-hero {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    object-position: 50% 70%;
    margin: 0;
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
}

.post-hero-caption {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    text-align: center;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.post-excerpt {
    font-size: 0.9rem;
    line-height: 1.5rem;
    color: #444;
    margin-bottom: 1rem;
}

.post-full {
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.post-full img {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
    height: auto;
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
}

.post-full figure {
    margin: 1.5rem 0;
}

.post-full figure img {
    margin: 0 auto 0.35rem;
}

.post-full figcaption {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    text-align: center;
}

.blog-post h2 {
    font-size: 1.4rem;
    line-height: 1.25;
    margin-bottom: 0.15em;
}

.post-full h2 {
    font-size: 1.15rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-full h3 {
    font-size: 1.05rem;
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
}

.post-full h4 {
    font-size: 0.95rem;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
}

.post-full p {
    margin-bottom: 1rem;
}

.post-full ul,
.post-full ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.post-full li {
    margin-bottom: 0.25rem;
}

.post-full blockquote {
    border-left: 4px solid #aaa;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    color: #555;
    font-style: italic;
}

.post-full pre {
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
    font-size: 0.85rem;
    line-height: 1.4;
}

.post-full pre code {
    background: none;
    padding: 0;
    color: inherit;
    border: none;
    font-size: inherit;
}

.post-full :not(pre) > code {
    background: #f0f0f0;
    padding: 0.1rem 0.3rem;
    color: #c41a16;
    font-size: 0.9em;
    border: 1px solid #ddd;
}

.post-actions {
    position: sticky;
    bottom: 0;
    width: 100%;
    z-index: 10;
    margin-top: 1rem;
    pointer-events: none;
}

/* Code block collapse toggle */
.code-collapse-wrapper {
    margin-bottom: 1.5rem;
    position: relative;
}

.code-collapse-wrapper pre {
    margin-bottom: 0;
}

.code-collapse-wrapper pre.code-collapsed {
    max-height: 22rem;
    overflow: hidden;
    position: relative;
    padding-bottom: 3rem;
}

.code-collapse-wrapper pre.code-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5rem;
    background: linear-gradient(transparent, #1e1e1e);
    pointer-events: none;
    z-index: 1;
}

.code-collapse-actions {
    width: 100%;
    margin-top: 0;
}

.read-more-btn {
    pointer-events: auto;
    display: block;
    width: 100%;
    text-align: center;
    font-family: 'Univers LT Pro', sans-serif;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    padding: 0.3rem 0;
    background-image: linear-gradient(
        45deg,
        #777 25%,
        transparent 25.5%,
        transparent 50%,
        #777 50.5%,
        #777 75%,
        transparent 75.5%,
        transparent
    );
    background-size: 10px 10px;
    background-color: var(--dynamic-bg-color, #fff);
    border: 1px dashed #000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    transition: background-color 0.2s, filter 0.2s;
}

.read-more-btn:hover {
    background-image: linear-gradient(
        45deg,
        #555 25%,
        transparent 25.5%,
        transparent 50%,
        #555 50.5%,
        #555 75%,
        transparent 75.5%,
        transparent
    );
    background-color: #f0f0f0;
}

.read-more-btn,
.read-more-btn:hover,
.read-more-btn:active,
.read-more-btn:focus,
.read-more-btn:visited {
    color: #000;
}

.read-more-btn:active {
    background: repeating-linear-gradient(-45deg, #aaa, #aaa .25rem, transparent .25rem, transparent .5rem), #e0e0e0;
}

.btn-text {
    background: #fff;
    padding: 2px 0.5rem;
    display: inline-block;
    font-family: TX-02-Data, 'Roboto Mono', Menlo, Courier, monospace;
    font-weight: 400;
    font-style: normal;
    line-height: 1.2rem;
    letter-spacing: .1rem;
    text-transform: uppercase;
    border: 1px dotted #000;
    margin: 0 1.5rem;
}

.read-more-btn:hover .btn-text {
    background-color: #fff;
    font-weight: 900;
}

/* Mermaid Diagram Styles */
.mermaid {
    display: block;
    margin: 1.5rem auto;
    padding: 1rem;
    text-align: center;
    overflow-x: auto;
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
    background: #fff;
}

.mermaid svg {
    max-width: 100%;
    height: auto;
}

/* Utility classes */
.text-center { text-align: center; }
.p-centered { display: block; float: none; margin-right: auto; margin-left: auto; }
.ba { border-width: 1px; border-style: solid; }
.b--black { border-color: #000; }
.b--solid { border-style: solid; }
.b--dotted { border-style: dotted; }
.pa2 { padding: .5rem; }
.pt2 { padding-top: .5rem; }
.pb1 { padding-bottom: .25rem; }
.pl3 { padding-left: 1rem; }
.pr3 { padding-right: 1rem; }
.text-bold { font-weight: 700; }
.mono { font-family: TX-02-Data, 'Roboto Mono', Menlo, Courier, monospace; }
.sans { font-family: 'Univers LT Pro', -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; }

/* Code Snippet Display */
pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    border-radius: 0;
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
    font-size: 0.85rem;
    line-height: 1.4;
    position: relative;
}

.pre-toolbar {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    z-index: 2;
}

.pre-toolbar .pre-lang,
.pre-toolbar .copy-btn {
    background: #000;
    color: #fff;
    font-family: 'Univers LT Pro', sans-serif;
    font-size: 0.6rem;
    padding: 2px 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: inherit;
    border-bottom: 1px solid #000;
}

.pre-toolbar .pre-lang {
    user-select: none;
    -webkit-user-select: none;
}

.pre-toolbar .copy-btn {
    border: none;
    border-left: 1px solid #000;
    border-bottom: 1px solid #000;
    cursor: pointer;
    transition: background 0.15s;
}

.pre-toolbar .copy-btn:hover {
    background: #333;
}

.pre-toolbar .copy-btn.copied {
    background: #1a7f37;
    pointer-events: none;
}

code {
    font-family: 'Fira Code', 'Roboto Mono', 'Courier New', Courier, monospace;
}

p code, li code {
    background: #f0f0f0;
    padding: 0.1rem 0.3rem;
    border-radius: 0;
    color: #c41a16;
    font-size: 0.9em;
    border: 1px solid #ddd;
}

/* Blog TOC Sidebar */
.blog-toc {
    position: fixed;
    left: max(1rem, calc((100vw - 60rem) / 2 - 14rem));
    top: 18rem;
    width: 12.5rem;
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
    z-index: 5;
    -ms-overflow-style: none;
    scrollbar-width: none;
    background: #fff;
    border: 1px solid #000;
    box-shadow: 2px 2px #ccc;
    padding: 0.75rem;
}

.blog-toc::-webkit-scrollbar {
    display: none;
}

.blog-toc .toc-title {
    font-family: TX-02-Data, 'Roboto Mono', Menlo, Courier, monospace;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.35rem;
    border-bottom: 1px dotted #000;
}

.blog-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-toc li {
    margin-bottom: 0.15rem;
    line-height: 1.3;
}

.blog-toc a {
    display: block;
    font-family: 'Univers LT Pro', -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    color: #555;
    text-decoration: none;
    padding: 0.15rem 0.35rem;
    border-left: 2px solid transparent;
    transition: color 0.12s, border-color 0.12s;
}

.blog-toc a:hover,
.blog-toc a.toc-active {
    color: #000;
    border-left-color: #000;
}

.blog-toc a.toc-h3 {
    padding-left: 1.1rem;
    font-size: 0.65rem;
    color: #777;
}

.blog-toc a.toc-h3:hover,
.blog-toc a.toc-active.toc-h3 {
    color: #000;
    border-left-color: #000;
}

@media (max-width: 90rem) {
    .blog-toc {
        display: none !important;
    }
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: TX-02-Data, 'Roboto Mono', Menlo, Courier, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px dotted #000;
    padding: 2px 0.5rem;
    color: #000;
    margin-bottom: 2rem;
}

.back-link:hover {
    background: #000;
    color: #fff;
}

/* Responsive Grid */
@media (max-width: 600px) {
    .col-sm-12 {
        width: 100%;
    }
    .project-tiles {
        grid-template-columns: 1fr;
    }
    .project-media-row {
        flex-direction: column;
    }
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .col-md-12 {
        width: 100%;
    }
}

@media (max-width: 60rem) {
    .main-container {
        margin: 0;
        width: 100%;
    }
}

/* Debug Panel */
#debug-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    opacity: 0.3;
    transition: opacity 0.3s;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 4px;
}

#debug-panel:hover {
    opacity: 1;
}

#debug-panel label {
    color: #000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

#debug-panel select {
    background: #fff;
    color: #000;
    border: 1px solid #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    cursor: pointer;
}

#fps-counter {
    color: #000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    margin: 0 auto;
    border: 1px solid #fff;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
}

/* ── Animated film grain overlay (CSS blend mode) ─────────────────────── */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('images/grain.gif');
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 9999;
}
