/* =========================================================
   1. RESET, FONTS & THEME VARIABLES
   ========================================================= */

@font-face {
    font-family: 'JetBrainsMono NF';
    src: url('fonts/JetBrainsMonoNerdFontMono-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

/* --- NEON YELLOW / HIGH-VOLTAGE CYBER THEME --- */
:root {
    --bg: #0c0d10;                            /* Deep carbon background */
    --text: #f4f5f8;                          /* Bright off-white */
    --accent: #fcee0a;                        /* Electric Neon Yellow */
    --secondary: #7f8497;                     /* Muted telemetry gray */
    --border: #23252e;                        /* Subtle dark border */
    --sidebar-bg: #14151b;                    /* Elevated container dark tone */
    --accent-faded: rgba(252, 238, 10, 0.12); /* Translucent yellow glow */
    --code-bg: #08090b;                       /* Terminal black for code */
    --success: #39ff14;                       /* Neon green */
    --container-bg: rgba(12, 13, 16, 0.94);
}

/* Optional Light Mode */
:root[data-mode="light"] {
    --bg: #f8f8f2;
    --text: #282a36;
    --accent: #9580ff;
    --secondary: #6272a4;
    --border: #d7d7cb;
    --sidebar-bg: #e6e6dc;
    --accent-faded: rgba(149, 128, 255, 0.15);
    --code-bg: #f1f1ea;
    --container-bg: rgba(248, 248, 242, 0.94);
}

/* =========================================================
   2. BASE & PAGE LAYOUT
   ========================================================= */

html {
    background-color: var(--bg);
    background-image: url('res/background.jpg');
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    background-repeat: no-repeat;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg);
    transition: background-color 0.3s ease;
}

body {
    font-family: 'JetBrainsMono NF', monospace;
    line-height: 1.6;
    color: var(--text);
    background: transparent;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    display: block;
}

.container {
    max-width: 1100px;
    width: 90%;
    margin: 2rem auto;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background-color: var(--container-bg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.container > * {
    min-width: 0;
}

section {
    margin-bottom: 2.5rem;
}

/* Global Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 4px;
    border: 2px solid var(--bg);
}

/* =========================================================
   3. TYPOGRAPHY & HEADINGS
   ========================================================= */

h1 {
    margin: 0;
    font-size: 2.5rem;
    letter-spacing: -1px;
}

h2 {
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.subtitle {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.github-link {
    color: var(--accent);
    text-decoration: none;
    font-family: inherit;
    font-weight: bold;
    display: inline-block;
    margin-top: 0.5rem;
    padding: 4px 12px;
    border: 1px solid var(--accent);
    border-radius: 20px;
    transition: background 0.2s ease, color 0.2s ease;
}

.github-link:hover {
    background: var(--accent);
    color: var(--bg);
}

/* =========================================================
   4. HEADER & INSIGNIA
   ========================================================= */

header.terminal-header {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.banner-frame {
    width: 100%;
    position: relative;
    border: 4px solid var(--border);
    padding: 4px;
    background: var(--sidebar-bg);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 21 / 9;
}

.banner {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.1) saturate(0.9);
}

.header-insignia {
    display: flex;
    justify-content: center;
    /* Pull up slightly more to account for the larger vertical height */
    margin: -2.5rem 0 1rem 0;
    position: relative;
    z-index: 2;
}

.insignia-img {
    /* Sized up from 72px to 130px (adjust between 120px - 160px to your taste) */
    width: 130px; 
    height: auto;
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.75));
    transition: transform 0.25s ease, filter 0.25s ease;
}

.insignia-img:hover {
    transform: translateY(-3px) scale(1.05);
    filter: drop-shadow(0 0 20px rgba(241, 250, 140, 0.45));
}

.prompt-container {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.prompt-container .prompt {
    color: var(--accent);
    margin-right: 8px;
}

.glitch {
    position: relative;
    font-size: 3rem;
    margin: 0;
    text-transform: uppercase;
}

.glitch:hover {
    text-shadow: 2px 0 var(--accent);
    animation: glitch-anim 0.2s linear infinite;
}

.status-badge {
    display: inline-block;
    margin-left: 15px;
    font-size: 0.7rem;
    font-family: inherit;
    background: var(--accent-faded);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--accent);
}

.blink {
    animation: blink-anim 1s infinite;
}

@keyframes blink-anim {
    50% { opacity: 0; }
}

@keyframes glitch-anim {
    0%   { transform: translate(0); }
    20%  { transform: translate(-2px, 1px); }
    40%  { transform: translate(-2px, -1px); }
    60%  { transform: translate(2px, 1px); }
    80%  { transform: translate(2px, -1px); }
    100% { transform: translate(0); }
}

/* =========================================================
   5. UI COMPONENTS (TERMINAL & ABOUT)
   ========================================= */

.terminal-window {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-top: 1.5rem;
}

.terminal-header {
    background: var(--border);
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.terminal-buttons { 
    display: flex; 
    gap: 6px; 
}

.terminal-buttons span {
    width: 10px; 
    height: 10px; 
    border-radius: 50%;
    background: var(--secondary); 
    opacity: 0.5;
}

.terminal-title {
    font-size: 0.75rem;
    color: var(--text);
    opacity: 0.7;
}

.terminal-content { 
    padding: 1.5rem; 
    font-size: 0.95rem; 
}

.about-grid { 
    display: grid; 
    grid-template-columns: 220px 1fr; 
    gap: 2rem; 
}

.about-status {
    border-right: 1px dashed var(--border);
    padding-right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.status-item .label { 
    font-size: 0.7rem; 
    color: var(--secondary); 
    font-weight: bold; 
}

.status-item .value { 
    color: var(--accent); 
    font-weight: bold; 
}

.about-text .prompt { 
    color: var(--accent); 
    font-weight: bold; 
    margin-right: 8px; 
}

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

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

.pulse-text { 
    animation: simple-pulse 2s infinite; 
}

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

.inline-title {
    height: 1.15em;
    width: auto;
    vertical-align: -0.2em;
    margin: 0 4px;
    display: inline-block;
     filter: brightness(0) invert(1);
    transition: transform 0.2s ease, filter 0.2s ease;
}

:root[data-mode="light"] .inline-title {
    filter: brightness(0); /* Turns all non-transparent pixels to pure black (#000000) */
}

.inline-title:hover {
    transform: scale(1.15);
}

/* =========================================================
   6. TECHNICAL CAPABILITIES (EQUAL CARDS & CENTERED LABEL)
   ========================================================= */

/* 1. Spans the entire row of the display */
.capabilities-section {
    width: 100vw;
    max-width: 100vw;
    margin: 3.5rem 0;
    padding: 2.5rem 4vw;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Centered Technical Capabilities Label */
.capabilities-header-wrap {
    width: 100%;
    max-width: 1500px;
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: center;
    text-align: center;
}

.capabilities-section h2 {
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    margin: 0 auto;
    font-size: 1.35rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-align: center;
}

/* 2. Grid taking up the full display width */
.capabilities-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    width: 100%;
    max-width: 1500px;
    box-sizing: border-box;
    align-items: stretch; /* Guarantees all 3 columns have the exact same total height */
}

/* 3. Column item containing the logo on top + card underneath */
.showcase-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    height: 100%;
}

/* 4. Strict, locked logo stage height (stops Vulkan from pulling the card up) */
.showcase-logo-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    min-height: 100px;
    width: 100%;
    flex-shrink: 0; /* Prevents vertical collapsing */
}

.showcase-logo {
    max-width: 160px;
    max-height: 85px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 20px rgba(255, 255, 255, 0.08));
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s ease;
}

.showcase-item:hover .showcase-logo {
    transform: translateY(-8px) scale(1.12);
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 25px var(--accent-faded));
}

/* 5. The Cards Underneath - Guaranteed 100% identical size */
.showcase-panel {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2.2rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    flex: 1; /* All 3 cards expand equally down to the exact same bottom line */
    box-sizing: border-box;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.showcase-item:hover .showcase-panel,
.showcase-panel:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-faded);
}

/* Glowing top accent line */
.showcase-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.showcase-item:hover .showcase-panel::before,
.showcase-panel:hover::before {
    opacity: 1;
}

/* Card Content Typography */
.showcase-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
    justify-content: flex-start;
}

.showcase-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.85rem;
}

.showcase-header .spec-id {
    font-size: 0.72rem;
    color: var(--secondary);
    letter-spacing: 1.5px;
}

.showcase-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text);
}

.showcase-body p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text);
    opacity: 0.88;
}

/* Mobile & Tablet responsiveness */
@media (max-width: 950px) {
    .capabilities-section {
        padding: 2rem 1.5rem;
    }

    .capabilities-showcase {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .showcase-logo-stage {
        height: 85px;
        min-height: 85px;
    }

    .showcase-logo {
        max-width: 130px;
        max-height: 75px;
    }
}
/* =========================================================
   7. PROJECTS & LOGS
   ========================================================= */

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    height: 100%;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.card-link:hover .card {
    border-color: var(--accent);
    background: var(--accent-faded);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.card-header h3 {
    margin: 0;
}

.star-badge {
    font-size: 0.85rem;
    color: var(--accent);
    background: var(--accent-faded);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Tech Stack Pills */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1rem;
}

.tech-stack span {
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--sidebar-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: default;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-stack span:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-faded);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Logs Section */
.log-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.log-item {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

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

.log-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.log-tag {
    color: var(--accent);
    background: var(--accent-faded);
    padding: 0 8px;
    border-radius: 4px;
}

.log-item h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.log-link {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.log-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.log-item p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--secondary);
}

/* Markdown Prose */
.prose {
    max-width: 800px;
    margin: 0 auto;
}

.prose h1 {
    font-size: 2.2rem;
    margin-top: 2rem;
    color: var(--accent);
}

.prose h2 {
    font-size: 1.6rem;
    margin-top: 1.5rem;
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.prose p {
    margin-bottom: 1.2rem;
    line-height: 1.8;
}

.prose pre {
    background: var(--code-bg);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border);
}

.prose code {
    font-size: 0.9rem;
}

.prose :not(pre) > code {
    background: var(--sidebar-bg);
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--accent);
}

/* =========================================================
   8. SIDEBAR WIDGETS (ASIDE)
   ========================================================= */

aside {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-block {
    background: var(--sidebar-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.sidebar-block h3 {
    margin-top: 0;
    font-size: 1rem;
    color: var(--accent);
    text-transform: uppercase;
}

.loading-text {
    font-size: 0.8rem;
    color: var(--secondary);
}

/* GitHub Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.stat-item {
    background: var(--bg);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent);
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--secondary);
    letter-spacing: 0.5px;
}

/* Contact Grid */
.contact-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.contact-row {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.contact-item-link {
    text-decoration: none;
    color: inherit;
}

.contact-value {
    font-weight: 600;
    color: var(--accent);
}

.contact-row:hover {
    border-color: var(--accent);
    background: var(--accent-faded);
    transform: translateX(4px);
}

.contact-row.copied .contact-value {
    color: var(--success);
}

/* Pull Requests */
.pr-list {
    list-style: none;
    padding: 0;
    font-size: 0.85rem;
}

.pr-item {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.pr-item:last-child {
    border: none;
}

.pr-item a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    display: block;
}

.pr-item a:hover {
    color: var(--accent);
}

.pr-repo {
    color: var(--secondary);
    font-size: 0.75rem;
}

/* =========================================================
   9. SIDE DRAWER NAVIGATION & SETTINGS
   ========================================================= */

.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--sidebar-bg);
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.2rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.sidebar-toggle:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg);
    border-right: 1px solid var(--border);
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.side-nav.active {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.25);
}

.side-nav-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--sidebar-bg);
}

.side-nav-title {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--secondary);
    letter-spacing: 1px;
}

.side-nav-close {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
    font-family: inherit;
}

.side-nav-links {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1.5rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-item span {
    color: var(--accent);
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background: var(--sidebar-bg);
    color: var(--accent);
    padding-left: 2rem;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 1rem 1.5rem;
}

#licenseBtn {
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 12px 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    color: var(--text);
}

#licenseBtn:hover {
    background: var(--sidebar-bg);
    color: var(--accent);
    padding-left: 2rem;
}

.side-nav-settings {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--sidebar-bg);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    height: 32px;
}

.side-nav-settings button, 
.custom-select {
    height: 32px;
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--accent);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

#modeToggle, #effectsToggle {
    padding: 0 10px;
    justify-content: center;
    min-width: 40px;
}

#modeToggle:hover, #effectsToggle:hover {
    border-color: var(--accent);
    background: var(--accent-faded);
}

.side-nav-footer {
    margin-top: auto;
    padding: 1.5rem;
    font-size: 0.75rem;
    color: var(--secondary);
    text-align: center;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

/* =========================================================
   10. CRT VISUAL EFFECTS
   ========================================================= */

html[data-effects="on"] .container {
    filter: contrast(1.05) brightness(1.05);
    box-shadow: 0 0 25px rgba(252, 238, 10, 0.08); /* Yellow ambient glow */
}

.crt-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1500;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    opacity: 0.2;
}

html[data-effects="on"] .crt-overlay {
    display: block;
}

html[data-effects="off"] #bg-canvas {
    display: none !important;
}

h1, h2, .nav-item {
    text-shadow: 1px 0 rgba(255, 0, 0, 0.25), -1px 0 rgba(0, 255, 255, 0.25);
}

/* =========================================================
   11. UNIFIED MODAL SYSTEM
   ========================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-window {
    width: 90%;
    max-width: 500px;
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-window {
    transform: translateY(0);
}

.modal-window.large {
    max-width: 750px;
}

.modal-content {
    background: var(--bg);
    max-height: 70vh;
    overflow-y: auto;
    color: var(--text);
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

#modalBody pre {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.85rem;
    color: var(--secondary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-size: 1.2rem;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--accent);
}

.project-modal {
    padding: 10px;
}

.project-modal h3 {
    margin-top: 0;
    color: var(--accent);
}

.project-modal .tech-stack {
    display: flex;
    gap: 8px;
    margin: 15px 0;
}

.project-modal .tech-stack span {
    background: var(--sidebar-bg);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--accent);
    border: 1px solid var(--border);
}

/* =========================================================
   12. TERMINAL COMMAND BAR & EXPLORER
   ========================================================= */

.cmd-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--accent);
    padding: 8px 20px;
    display: none;
    align-items: center;
    z-index: 3000;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.2s ease-out;
}

.cmd-bar.active {
    display: flex;
}

.cmd-prompt {
    color: var(--accent);
    margin-right: 12px;
    font-weight: bold;
    font-size: 1.1rem;
}

#cmd-input {
    background: transparent;
    border: none;
    color: var(--text);
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    padding: 0;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* File Explorer */
.explorer-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.explorer-item {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.explorer-item:hover {
    background: var(--accent-faded);
}

.explorer-item .icon {
    color: var(--accent);
}

.explorer-content {
    background: #0d1117;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    margin: 0;
}

.explorer-content code {
    white-space: pre;
}

.explorer-back-btn {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.explorer-back-btn:hover {
    background: var(--accent-faded);
    border-color: var(--accent);
}

/* Readme / Man Pages */
.man-page {
    text-align: left;
    color: var(--text);
    padding-bottom: 2rem;
}

.man-page h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
}

.man-page h2 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    color: var(--accent);
    border: none;
}

.man-page h3 {
    font-size: 1.1rem;
    margin-top: 1rem;
}

.man-page p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

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

.man-page li {
    margin-bottom: 0.4rem;
}

.man-page a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.man-page pre {
    margin: 1.5rem 0;
    background: #000;
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 6px;
}

.man-page code {
    font-size: 0.85rem;
}

/* =========================================================
   13. FOOTER & TELEMETRY (FULL-WIDTH EDGE-TO-EDGE)
   ========================================================= */

/* Ensure the footer doesn't clip the mascot peeking over the top border */
footer {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-top: 4rem;
    padding: 2.5rem 0 2rem 0;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    box-sizing: border-box;
    overflow: visible;                   /* Allows N's head/hat to break over the footer edge */
}

/* Mascot PNG - Sized to match your yellow marker line */
.footer-corner-img {
    position: absolute;
    right: 2.5rem;                       /* Distance from the right screen edge */
    bottom: 0;                           /* Anchored flush to the bottom edge */
    height: 240px;                       /* Sized up to span the full footer height */
    max-height: none;                    /* Uncapped */
    width: auto;
    max-width: none;                     /* Uncapped */
    object-fit: contain;
    opacity: 0.95;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.85));
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s ease;
    pointer-events: auto;
    z-index: 10;
}

.footer-corner-img:hover {
    transform: translateY(-8px) scale(1.05);
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 20px rgba(252, 238, 10, 0.25));
}

/* Responsive safety: scale down so it doesn't cover text on smaller displays */
@media (max-width: 1100px) {
    .footer-corner-img {
        height: 180px;
        right: 1.5rem;
    }
}

@media (max-width: 768px) {
    .footer-corner-img {
        height: 110px;
        right: 1rem;
        opacity: 0.6;
    }
}

/* Keeps the telemetry and copyright aligned with your main content width */
.footer-container {
    width: 90%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-telemetry {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.telemetry-item {
    display: flex;
    gap: 8px;
}

.telemetry-item .label {
    color: var(--secondary);
}

.telemetry-item .value {
    color: var(--accent);
    font-weight: bold;
}

.status-ok {
    color: var(--success);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border);
    padding-top: 1.5rem;
    font-size: 0.8rem;
}

.source-code {
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-code a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.source-code a:hover {
    color: var(--accent);
}

.copyright {
    color: var(--secondary);
    margin: 0;
}

/* =========================================================
   14. CUSTOM HARDWARE-ACCELERATED CURSOR
   ========================================================= */

@media (pointer: fine) {
    *, *::before, *::after {
        cursor: none !important;
    }
}

#custom-cursor-container {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    will-change: transform;
    opacity: 0;
    transition: opacity 0.15s ease;
    transform: translate3d(-100px, -100px, 0);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

#cursor-triangle {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    z-index: 2;
    transition: fill 0.15s ease;
}

#custom-cursor-canvas {
    position: absolute;
    top: 0px;
    left: 9px;
    width: 24px;
    height: 24px;
    display: block;
    transform-origin: center center;
    will-change: transform;
    z-index: 1;
}

#custom-cursor-canvas.spin {
    animation: cursor-spin-revolution 0.42s cubic-bezier(0.18, 0.89, 0.32, 1.15) forwards;
}

@keyframes cursor-spin-revolution {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================================
   15. CONSOLIDATED RESPONSIVE BREAKPOINTS
   ========================================================= */

@media (max-width: 950px) {
    .container {
        grid-template-columns: 1fr;
        width: 100%;
        margin: 0;
        border-radius: 0;
        border: none;
        padding: 1.5rem;
    }

    header { order: 1; }
    main   { order: 2; }
    aside  { order: 3; }
    footer { order: 4; }

    header .banner {
        border-radius: 0;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    header.terminal-header {
        margin-bottom: 2rem;
        gap: 1rem;
        text-align: center;
    }

    .banner-frame {
        aspect-ratio: 16 / 9;
        border-width: 2px;
        border-radius: 8px;
    }

    .glitch {
        font-size: 2.2rem;
    }

    .header-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .status-badge {
        margin-left: 0;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-status {
        border-right: none;
        border-bottom: 1px dashed var(--border);
        padding-right: 0;
        padding-bottom: 1rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .status-item {
        flex: 1 1 120px;
    }

    .footer-telemetry {
        gap: 0.5rem 1.5rem;
        justify-content: flex-start;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    .header-insignia {
        margin: -1.8rem 0 0.8rem 0;
    }

    .insignia-img {
        width: 95px;
    }
}
