@font-face {
    font-family: 'mssansserif';
    src: url("../../fonts/mssansserif.ttf");
}

/* =========================================
   Reset & Base
   ========================================= */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* For full-width breakouts */
}

/* =========================================
   Variables
   ========================================= */
:root {
    --bg-color: #f7f5f0;
    --text-color: #0d0d0d;
    --accent-primary: #000000;
    --accent-secondary: #404040;
    --border-color: #0d0d0d;
    --window-bg: #f3f3f3;
    --title-bar-bg: #0d0d0d;
    --selection-bg: #000000;
    --selection-text: #ffffff;
    --link-color: #000;

    --font-mono: 'JetBrains Mono', monospace;
    --font-header: 'VT323', monospace;
    /* Added for consistency if used */

    --bevel-light: #ffffff;
    --bevel-dark: #dadada;
    --bevel-shadow: #000000;

    /* Music player root colors */
    --rp-window-bg: var(--window-bg);
    --rp-accent: var(--accent-primary);
    --rp-highlight: var(--title-bar-bg);
    --rp-light: var(--bevel-light);
    --rp-dark: var(--bg-color);
    --rp-text: var(--text-color);
}

html.dark-mode {
    --bg-color: #121212;
    --text-color: #ffffff;
    --accent-primary: #ffffff;
    --accent-secondary: #aaaaaa;
    --border-color: #ffffff;
    --window-bg: #0b0b0b;
    --title-bar-bg: #ffffff;
    --selection-bg: #ffffff;
    --selection-text: #000000;
    --link-color: #FFF;

    --bevel-light: #000000;
    --bevel-dark: #000000;
    --bevel-shadow: #000000;
}

/* =========================================
   Typography & Global Elements
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

h1 {
    font-size: 3rem;
    color: var(--accent-primary);
    border-bottom: none;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    margin-top: 0rem;
    line-height: 1.1;
    font-weight: bold;
}

h2 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-top: 2rem;
    font-weight: 900;
    padding-bottom: 0.5rem;
}

p {
    letter-spacing: -0.1px;
    margin: 1rem 0 1rem 0;
    line-height: 1.5;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

a:hover {
    background-color: var(--selection-bg);
    color: var(--selection-text);
}

img {
    max-width: 100%;
    height: auto;
    border: 2px solid var(--text-color);
}

blockquote {
    border-left: 6px solid var(--accent-primary);
    padding-left: 1rem;
    margin-left: 1rem;
}

li {
    font-size: 1rem;
    padding-left: 1rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.tagged {
    font-size: 1rem;
    color: var(--selection-text);
    padding-bottom: 1rem;
    margin: 1rem 0 2rem 0;
    line-height: 1;
}

.tagged-link {
    color: var(--selection-text);
    text-decoration: none;
    border-bottom: none;
}

/* =========================================
   Site Layout Layers
   ========================================= */
main,
.commentbox,
#disqus_thread {
    max-width: 1400px;
    width: 98%;
    margin: 0 auto;
    padding: 3rem 1rem;
}

main.individual-post,
main.individual-post~.commentbox,
main.individual-post~#disqus_thread {
    max-width: 940px;
}

/* Home Grid Layout */
.home-grid {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    align-items: center;
    margin-top: 2rem;
}

.right-column {
    width: 100%;
    max-width: 1300px;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Breakout Utility (Full Width Sections) */
.breakout-section {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 3rem 0;
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.breakout-inner {
    max-width: 1300px;
    width: 95%;
    margin: 0 auto;
    padding: 0 1rem;
}

.breakout-section .index-extras-grid {
    margin-bottom: 0;
}

/* Background Variants */
.bg-alt {
    background-color: var(--window-bg);
    border-top: 2px dashed var(--text-color);
    border-bottom: 2px dashed var(--text-color);
}

.bg-accent {
    background-color: var(--title-bar-bg);
    color: var(--bg-color);
}

.bg-accent h3 {
    color: var(--bg-color);
    border-bottom-color: var(--bg-color) !important;
}

.bg-accent .system-row {
    border-bottom-color: var(--bevel-dark);
}

.bg-accent .tool-badge {
    border-color: var(--bg-color);
    color: var(--bg-color);
    background: transparent;
}

.bg-accent .tool-badge:hover {
    background: var(--bg-color);
    color: var(--title-bar-bg);
}

.bg-accent .project-simple-card {
    background: transparent;
    border-color: var(--bg-color);
    color: var(--bg-color);
    box-shadow: 4px 4px 0px var(--bg-color);
}

.bg-accent .project-simple-card h2,
.bg-accent .project-simple-card h4 {
    color: var(--bg-color);
}

/* =========================================
   Site Structure: Nav, Header, Footer
   ========================================= */
/* Navigation */
nav {
    position: relative;
    top: 0;
    max-width: 100%;
    width: 100%;
    margin: 0;
    z-index: 100;
    background: var(--title-bar-bg);
    border: 2px solid var(--text-color);
    padding: 0.5rem;
    box-sizing: border-box;
    box-shadow:
        inset 1px 1px 0px var(--bevel-light),
        inset -1px -1px 0px var(--bevel-dark);
}

nav ol {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

nav a {
    color: var(--bg-color) !important;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 1.1rem;
    white-space: nowrap;
}

#theme-toggle {
    text-shadow: none !important;
    box-shadow: none !important;
    color: var(--bg-color) !important;
    padding: 0 0.5rem !important;
    line-height: 1;
}

@media (max-width: 700px) {
    nav {
        padding: 0.3rem;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    nav::-webkit-scrollbar {
        display: none;
    }

    nav ol {
        gap: 0.8rem;
        flex-wrap: nowrap;
        display: flex;
        width: 100%;
        justify-content: center;
    }

    nav a {
        font-size: 0.75rem;
    }

    #theme-toggle {
        font-size: 0.9rem !important;
        padding: 0.3rem !important;
    }
}

/* Header */
header {
    background: var(--title-bar-bg);
    padding-left: 1rem;
    padding-bottom: 0.5rem;
    border: 2px solid var(--border-color);
    margin-bottom: 3.5rem;
    box-shadow: 4px 4px 0px var(--border-color);
}

header h1 {
    color: var(--bg-color) !important;
    border-bottom: none;
    margin-bottom: 0;
    text-shadow: none;
}

header time {
    color: var(--bg-color) !important;
    opacity: 0.9;
    text-shadow: none;
}

header .header-title {
    color: var(--bg-color) !important;
    font-size: 1.2rem !important;
    margin-top: 1rem;
}

@media (max-width: 700px) {
    header {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 2px solid var(--text-color);
    background: var(--title-bar-bg);
    color: var(--bg-color);
    margin-top: 4rem;
    width: 100%;
    max-width: 100%;
    box-shadow:
        inset 1px 1px 0px var(--bevel-light),
        inset -1px -1px 0px var(--bevel-dark);
}

footer a {
    color: var(--bg-color) !important;
    text-decoration: underline;
}

/* =========================================
   Global Components
   ========================================= */
/* Window Aesthetic */
.window {
    background: var(--window-bg);
    border: 2px solid var(--border-color);
    margin-bottom: 2.5rem;
    position: relative;
    box-shadow: 4px 4px 0px var(--border-color);
}

.title-bar {
    background: var(--title-bar-bg);
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    border-bottom: 2px solid var(--border-color);
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--bg-color);
}

.title-bar.inactive {
    filter: grayscale(1);
    opacity: 0.8;
}

.window-body {
    padding: 2rem;
    background: var(--window-bg);
}

.title-bar-controls {
    display: flex;
    gap: 4px;
}

.title-bar-controls button {
    width: 20px;
    height: 20px;
    min-width: 20px;
    padding: 0;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: 1px solid var(--title-bar-bg);
    color: var(--title-bar-bg);
    box-shadow: none;
    cursor: pointer;
    font-weight: bold;
}

.title-bar-controls button:hover {
    background: var(--title-bar-bg);
    color: var(--bg-color);
    transform: none;
    box-shadow: none;
}

/* Buttons */
button,
.btn {
    background: var(--accent-primary);
    color: var(--bg-color);
    border: 2px solid var(--text-color);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow:
        inset 1px 1px 0px var(--bevel-light),
        inset -1px -1px 0px var(--bevel-dark),
        4px 4px 0px var(--text-color);
    transition: transform 0.1s, box-shadow 0.1s;
}

button:active,
.btn:active {
    transform: translate(2px, 2px);
    box-shadow:
        inset -1px -1px 0px var(--bevel-light),
        inset 1px 1px 0px var(--bevel-dark),
        2px 2px 0px var(--text-color);
}

/* Tags & Badges */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    border: 1px solid #fff;
    padding: 2px 8px;
    color: #fff !important;
    text-shadow: 1px 1px #000;
    font-weight: bold;
    text-decoration: none;
}

.tag:hover {
    background: #fff;
    color: var(--accent-primary) !important;
    text-shadow: none;
}

.tool-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--text-color);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    margin: 0;
    transition: all 0.2s;
    background: var(--bg-color);
}

.tool-badge:hover {
    background: var(--accent-primary);
    color: var(--bg-color);
    transform: translate(-2px, -2px);
    box-shadow: 2px 2px 0px var(--text-color);
}

/* System Rows */
.system-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--accent-secondary);
    font-size: 0.9rem;
}

.system-row:last-child {
    border-bottom: none;
}

.system-label {
    opacity: 0.7;
    font-family: var(--font-mono);
}

.system-value {
    font-weight: bold;
    text-align: right;
}

/* =========================================
   Page Specific: Home / Index
   ========================================= */
/* =========================================
   Page Specific: Home / Index (new Style)
   ========================================= */

.page-wrapper {
    max-width: 1300px;
    width: 95%;
    margin: 0 auto;
    padding: 0 1rem;
    padding-bottom: 6rem;
}

.new-divider {
    border: 0;
    border-top: 1px solid var(--text-color);
    margin: 4rem 0;
    opacity: 0.3;
}

/* HERO */
.new-hero {
    margin-top: 4rem;
    margin-bottom: 6rem;
}

/* ABOUT GRID */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 900px) {
    .new-hero {
        grid-template-columns: 1fr;
        gap: 3rem;

    }


}

.new-hero-header {
    margin-bottom: 2rem;
}

.new-hero-header h1 {
    font-size: 0;
    /* Hide text, show logo */
    line-height: 0;
    margin: 0;
}

.new-hero-intro {
    font-size: 2.2rem;
    line-height: 1.2;
    max-width: 40ch;
    font-family: var(--font-header);
    letter-spacing: -0.5px;
}

.new-hero-intro strong {
    font-weight: 400;
    /* Regular weight for header font if needed, or bold */
}

.new-hero-intro .highlight {
    color: var(--accent-secondary);
}

/* GRID SECTIONS */
.new-grid-section {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.new-col-left h2 {
    font-size: 1rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    margin-top: 0;
    opacity: 0.6;
    letter-spacing: 1px;
}

/* CAPABILITIES */
.capability-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.capability-item {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
}

.cap-title {
    font-size: 2rem;
    font-family: var(--font-header);
    margin-bottom: 0.5rem;
}

.cap-desc {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* PROJECT LIST */
.new-project-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.new-project-list li {
    padding: 0;
    margin-bottom: 1rem;
}

.project-link {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 2.5rem;
    /* Big text for projects */
    font-family: var(--font-header);
    color: var(--text-color);
    text-decoration: none;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
    line-height: 1.1;
}

.project-link:hover {
    color: var(--accent-primary);
    padding-left: 1rem;
    background: transparent;
    /* Override default hover */
}

.project-name {
    position: relative;
}

.project-cat {
    font-size: 1rem;
    font-family: var(--font-mono);
    opacity: 0.5;
    transform: translateY(-5px);
}

.project-link.view-all {
    font-size: 1.5rem;
    margin-top: 2rem;
    opacity: 0.7;
}

/* PROJECT GALLERY PREVIEW */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

.gallery-item {
    position: relative;
    display: flex;
    flex-direction: column;
    aspect-ratio: 4/3;
    overflow: hidden;
    border: 2px solid var(--text-color);
    text-decoration: none !important;
    background: var(--window-bg);
    line-height: 0;
    margin: 0;
    padding: 0;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), filter 0.3s ease;
    border: none;
    display: block;
    margin: 0;
    padding: 0;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-title {
    font-family: var(--font-header);
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.25rem;
    color: #ffffff;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.gallery-cat {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    color: #ffffff;
    transform: translateY(10px);
    transition: transform 0.3s ease 0.05s;
}

.gallery-item:hover .gallery-title,
.gallery-item:hover .gallery-cat {
    transform: translateY(0);
}

.view-all-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* BLOG LIST */
.new-blog-list {
    list-style: none;
    padding: 0;
}

.new-blog-list li {
    padding: 0;
    margin-bottom: 0.5rem;
    padding-left: 0;
}

.new-blog-list a {
    display: flex;
    gap: 2rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.new-blog-list a:hover {
    padding-left: 0.5rem;
    background: transparent;
    color: var(--accent-primary);
}

.post-date {
    font-family: var(--font-mono);
    opacity: 0.6;
    min-width: 120px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .new-grid-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .new-col-left {
        margin-bottom: 1rem;
    }

    .new-hero-intro {
        font-size: 1.5rem;
    }

    .project-link {
        font-size: 1.8rem;
    }

    .project-link {
        flex-direction: column;
        gap: 0;
    }

    .project-cat {
        transform: none;
        margin-top: 0.2rem;
        margin-bottom: 1rem;
    }
}

.left-column .home-hero h1 {
    font-size: 3.5rem;
    line-height: 1;
}

@media (max-width: 900px) {
    .left-column .home-hero h1 {
        font-size: 4rem;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .home-hero h1 {
        font-size: 2rem;
    }

    /* .home-hero h1::after {
        font-size: 2rem;
    }

    .home-hero h1.no-smiley {
        font-size: 3rem;
    } */

    body {
        font-size: 0.8rem;
    }

    .hero-text {
        font-size: 0.8rem;
    }
}

/* Index Extras */
.index-extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
    margin-bottom: 2.5rem;
}

.knick-knacks-section {
    width: 100%;
    max-width: 1200px;
    margin-top: 1rem;
    padding-top: 2rem;
    border-top: 2px dashed var(--text-color);
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    align-items: start;
}

.knick-knacks-section .sidebar-label h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--text-color);
    font-family: var(--font-mono);
}

.sidebar-checkbox {
    display: none;
}

@media (max-width: 900px) {
    .knick-knacks-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* =========================================
   Page Specific: Portfolio & Projects
   ========================================= */
/* Expanding Gallery (New Responsive) */
.expanding-gallery {
    display: grid;
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
    padding: 0;
}

.expanding-item {
    position: relative;
    background: var(--accent-primary);
    overflow: hidden;
    border: 2px solid var(--text-color);
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.expanding-item:nth-child(2n) {
    background: var(--accent-secondary);
}

.expanding-item:nth-child(3n) {
    background: var(--tool-bg);
}

.expanding-item img {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    object-fit: cover;
    filter: grayscale(0%);
    transition: all 0.4s ease;
    opacity: 1;
}

.expanding-item:hover img {
    filter: grayscale(100%);
    opacity: 0.4;
    transform: scale(1.05);
}

.expanding-caption {
    position: relative;
    z-index: 2;
    color: #FFF;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 300ms 100ms;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.expanding-item:hover .expanding-caption {
    opacity: 1;
}

.expanding-caption h3 {
    margin: 0;
    font-size: 2rem;
    font-family: var(--font-header);
    text-transform: uppercase;
    text-shadow: 1px 1px 2px black;
}

/* Mobile Layout: 1 column, stacked */
@media (max-width: 767px) {
    .expanding-gallery {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
    }
}

/* Desktop Layout: 3 columns with expansion effect */
@media (min-width: 768px) {
    .expanding-gallery {
        grid-template: 1fr / 1fr 1fr 1fr;
        aspect-ratio: 16 / 9;
        transition: grid-template 300ms 150ms;
    }

    .expanding-gallery:has(.expanding-item:hover) {
        transition: grid-template 300ms;
    }

    .expanding-gallery:has(.expanding-item:nth-child(3n - 2):hover) {
        grid-template: 1fr / 2.5fr 1fr 1fr;
    }

    .expanding-gallery:has(.expanding-item:nth-child(3n - 1):hover) {
        grid-template: 1fr / 1fr 2.5fr 1fr;
    }

    .expanding-gallery:has(.expanding-item:nth-child(3n):hover) {
        grid-template: 1fr / 1fr 1fr 2.5fr;
    }
}

/* Project Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.year-header {
    margin-top: 3rem;
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 0.5rem;
    font-size: 1.2rem;
}

.project-simple-card {
    background: var(--window-bg);
    border: 1px solid var(--text-color);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    box-shadow:
        1px 1px 0px var(--bevel-light) inset,
        -1px -1px 0px var(--bevel-dark) inset,
        4px 4px 0px var(--border-color);
}

.project-simple-card h2 {
    font-size: 1rem;
    margin: 0;
    color: var(--accent-primary);
}

.project-simple-card h3 {
    font-size: 0.85rem;
    margin: 0.25rem 0;
    opacity: 0.8;
}

.project-simple-card-dark {
    background: var(--text-color);
    border: 1px solid var(--window-bg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    box-shadow:
        4px 4px 0px var(--window-bg);
    color: var(--window-bg);
}

.project-simple-card-dark h2,
.project-simple-card-dark h3 {
    margin: 0;
    color: var(--window-bg);
    font-size: 1rem;
    border-bottom: 1px solid var(--window-bg);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.project-simple-card-dark ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-simple-card-dark ul li {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.project-simple-card p {
    font-size: 0.85rem;
    margin: 1rem 0 0 0;
    line-height: 1.4;
}

/* Masonry & Grids (Legacy/Secondary) */
.portfolio-masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.portfolio-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

@media (max-width: 900px) {

    .portfolio-masonry-grid,
    .portfolio-thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

.portfolio-thumbnail {
    background: var(--window-bg);
    border: 2px solid var(--text-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.portfolio-thumbnail:hover {
    transform: translate(-4px, -4px);
    box-shadow: 8px 8px 0px var(--accent-primary);
}

.portfolio-thumbnail-image {
    aspect-ratio: 3/4;
    overflow: hidden;
    border-bottom: 2px solid var(--text-color);
    display: flex;
    background: #000;
}

.portfolio-thumbnail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
    border: none !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
    text-align: center;
    pointer-events: none;
}

.portfolio-thumbnail:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay span {
    color: #fff;
    font-family: var(--font-mono);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1.2rem;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px #000;
}

.portfolio-thumbnail-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.portfolio-thumbnail-title a {
    color: var(--text-color) !important;
    font-size: 1.2rem;
}

.portfolio-thumbnail-title a:hover {
    color: var(--bg-color) !important;
}

.portfolio-thumbnail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
}

.portfolio-thumbnail-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    border: 1px solid var(--text-color);
    padding: 2px 6px;
}

/* =========================================
   Page Specific: About & Profile
   ========================================= */
.profile-avatar-container {
    padding: 1rem;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--text-color);
}

.profile-avatar {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border: 4px solid var(--accent-primary) !important;
    image-rendering: pixelated;
}

.profile-name {
    color: var(--accent-green);
    margin-bottom: 0.5rem;
}

.profile-title {
    font-size: 0.9rem;
    opacity: 0.8;
}

.about-profile-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 2rem;
    background: var(--window-bg);
    border: 2px solid var(--accent-primary);
    margin-bottom: 3rem;
    box-shadow:
        1px 1px 0px var(--bevel-light) inset,
        -1px -1px 0px var(--bevel-dark) inset;
}

.about-avatar-container .profile-avatar {
    width: 180px;
    height: 180px;
    border: 2px solid var(--accent-primary);
}

.about-profile-info .profile-name {
    margin: 0;
    color: var(--accent-primary);
}

.about-profile-info .profile-title {
    margin: 0.5rem 0 0 0;
    opacity: 0.7;
    font-size: 0.9rem;
}

.about-profile-quote .quote-text {
    font-size: 1.4rem;
    line-height: 1.1;
    font-weight: bold;
    color: var(--accent-primary);
    text-transform: uppercase;
}

.about-profile-quote .quote-sub {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}

.about-profile-info {
    flex: 1;
}

.about-contact-links {
    margin-top: 1rem;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.about-contact-links a {
    color: var(--accent-primary);
    text-decoration: none;
}

.about-contact-links a:hover {
    color: var(--bg-color);
}

/* Social Icons Theme Logic */
.theme-icon-light,
.theme-icon-dark {
    width: 20px;
    height: 20px;
    border: none !important;
    margin: 0;
    vertical-align: middle;
    transition: none;
    /* Instant swap */
}

/* Default State (Light Mode) */
.theme-icon-light {
    display: inline-block;
}

.theme-icon-dark {
    display: none;
}

/* Light Mode Hover: Show Dark Icon (White) */
a:hover .theme-icon-light {
    display: none;
}

a:hover .theme-icon-dark {
    display: inline-block;
}

/* Dark Mode State */
html.dark-mode .theme-icon-light {
    display: none;
}

html.dark-mode .theme-icon-dark {
    display: inline-block;
}

/* Dark Mode Hover: Show Light Icon (Black) */
html.dark-mode a:hover .theme-icon-light {
    display: inline-block;
}

html.dark-mode a:hover .theme-icon-dark {
    display: none;
}

.about-profile-quote {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    text-align: right;
    padding-left: 2rem;
    border-left: 1px dashed var(--text-color);
    opacity: 0.8;
}

@media (max-width: 800px) {
    .about-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-profile-quote .quote-text {
        font-size: 1.1rem;
    }
}

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.work-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    margin-top: 1.5rem;
}

.work-grid.note-split {
    display: grid;
    grid-template-columns: 1fr 2fr;
}

.work-grid ul {
    margin: 0;
    padding-left: 1.2rem;
}

.work-note {
    font-size: 0.85rem;
    padding: 1.5rem;
    background: var(--window-bg);
    border: 1px solid var(--text-color);
    box-shadow:
        inset 1px 1px 3px rgba(0, 0, 0, 0.1),
        inset -1px -1px 0px var(--bevel-light);
    position: relative;
}

.work-note.note-split {
    margin-top: 1rem;
}

.work-note::before {
    content: "SYSTEM NOTE";
    position: absolute;
    top: -10px;
    left: 10px;
    background: var(--selection-bg);
    color: var(--bg-color);
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: bold;
    border: 1px solid var(--text-color);
}

@media (max-width: 960px) {
    .work-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* =========================================
   Music Player & Extras
   ========================================= */
#latest_posts {
    list-style: none;
    padding: 0;
}

#latest_posts li {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--accent-primary);
}

.rp-desk {
    background: var(--bg-color);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    padding: 1rem;
    margin: 2rem 0;
    font-family: var(--font-mono);
}

.rp-window {
    background: var(--window-bg);
    border: 1px solid var(--text-color);
    box-shadow:
        1px 1px 0px var(--bevel-light) inset,
        -1px -1px 0px var(--bevel-dark) inset,
        -2px -2px 0px var(--bevel-shadow) inset,
        2px 2px 0px var(--bevel-light) inset,
        4px 4px 0px var(--border-color);
    display: flex;
    flex-direction: column;
}

.rp-player-win {
    flex: 1;
    min-width: 280px;
    max-height: 500px;
}

.rp-list-win {
    flex: 1;
    min-width: 280px;
    height: 300px;
    max-height: 500px;
}

.rp-title-bar-alt {
    background: var(--title-bar-bg);
    color: var(--bg-color);
    padding: 0 0.75rem;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--text-color);
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
}

.rp-win-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rp-track-display {
    border: 2px solid var(--text-color);
    padding: 1rem;
    text-align: center;
    background: var(--window-bg);
    box-shadow: inset 2px 2px 0px var(--bevel-dark);
}

.rp-progress-box {
    height: 15px;
    border: 2px solid var(--rp-accent);
    cursor: pointer;
    position: relative;
    background: var(--rp-dark);
    overflow: hidden;
}

.rp-progress-fill {
    height: 100%;
    background: var(--rp-accent);
    width: 0%;
    transition: width 0.1s;
    pointer-events: none;
}

.rp-controls {
    display: flex;
    gap: 10px;
}

.rp-btn {
    flex: 1;
    background: var(--accent-primary);
    color: #ffffff;
    border: 2px solid var(--text-color);
    padding: 0.5rem;
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    box-shadow:
        inset 1px 1px 0px var(--bevel-light),
        inset -1px -1px 0px var(--bevel-dark),
        2px 2px 0px var(--text-color);
    transition: transform 0.1s;
}

.rp-btn:active {
    transform: translate(1px, 1px);
    box-shadow:
        inset -1px -1px 0px var(--bevel-light),
        inset 1px 1px 0px var(--bevel-dark),
        1px 1px 0px var(--text-color);
}

.rp-playlist {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    height: 100%;
    background: var(--rp-dark);
}

.rp-track-item {
    padding: 4px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-color);
}

.rp-track-item.active {
    background: var(--selection-bg);
    color: var(--selection-text);
}

/* =========================================
   Utilities
   ========================================= */
.smallimage {
    width: 100%;
    height: auto;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* =========================================
   Papiro Logo Theme Toggle
   ========================================= */
.papiro-logo-light,
.papiro-logo-dark {

    width: auto;
    vertical-align: middle;
    border: none !important;
    box-shadow: none !important;
    max-width: 100%;
    margin-bottom: 0.6em;
}

/* Default (Light) state */
.papiro-logo-light {
    display: inline-block;
}

.papiro-logo-dark {
    display: none;
}

/* Dark Mode Logic */
html.dark-mode .papiro-logo-light {
    display: none;
}

html.dark-mode .papiro-logo-dark {
    display: inline-block;
}