/* Import Nerd Font (using FiraCode Nerd Font via CDN) */
@import url('https://www.nerdfonts.com/assets/css/webfont.css');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&display=swap');

/* Catppuccin Mocha Palette */
:root {
    --ctp-base: #1e1e2e;
    --ctp-mantle: #181825;
    --ctp-crust: #11111b;
    --ctp-text: #cdd6f4;
    --ctp-subtext0: #a6adc8;
    --ctp-surface0: #313244;
    --ctp-overlay0: #6c7086;
    --ctp-blue: #89b4fa;
    --ctp-lavender: #b4befe;
    --ctp-green: #a6e3a1;
    --ctp-red: #f38ba8;
    --ctp-peach: #fab387;
    --ctp-yellow: #f9e2af;
    --ctp-mauve: #cba6f7;
}

/* Global Box Sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    /* Animated Gradient Background - Darker Theme */
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #141e30);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    font-family: 'Fira Code', monospace;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* CRT Scanline Effect Overlay */
body::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 100;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    /* Ensure clicks pass through */
}

/* Window Container */
#window {
    width: 90vw;
    height: 90vh;
    background-color: rgba(30, 30, 46, 0.85);
    /* Glassmorphism */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--ctp-surface0);
    z-index: 101;

    /* Initial State for Animation */
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

#window.window-visible {
    opacity: 1;
    transform: scale(1);
}

/* Boot Screen Overlay */
#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0f0c29;
    /* Match body bg start */
    z-index: 9999;
    font-family: 'Fira Code', monospace;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.boot-content {
    text-align: center;
    color: var(--ctp-text);
}

.boot-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

.boot-bar-container {
    width: 200px;
    height: 4px;
    background-color: var(--ctp-surface0);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
    opacity: 0;
    animation: fadeIn 0.5s ease 0.5s forwards;
}

.boot-bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--ctp-blue);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--ctp-blue);
    transition: width 0.1s linear;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

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

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f0c29;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

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

    5% {
        clip: rect(70px, 9999px, 90px, 0);
    }

    10% {
        clip: rect(20px, 9999px, 60px, 0);
    }

    15% {
        clip: rect(80px, 9999px, 5px, 0);
    }

    20% {
        clip: rect(10px, 9999px, 80px, 0);
    }

    25% {
        clip: rect(90px, 9999px, 20px, 0);
    }

    30% {
        clip: rect(50px, 9999px, 50px, 0);
    }

    35% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    40% {
        clip: rect(60px, 9999px, 70px, 0);
    }

    45% {
        clip: rect(20px, 9999px, 10px, 0);
    }

    50% {
        clip: rect(80px, 9999px, 50px, 0);
    }

    55% {
        clip: rect(10px, 9999px, 90px, 0);
    }

    60% {
        clip: rect(40px, 9999px, 20px, 0);
    }

    65% {
        clip: rect(70px, 9999px, 60px, 0);
    }

    70% {
        clip: rect(30px, 9999px, 40px, 0);
    }

    75% {
        clip: rect(90px, 9999px, 10px, 0);
    }

    80% {
        clip: rect(20px, 9999px, 80px, 0);
    }

    85% {
        clip: rect(60px, 9999px, 30px, 0);
    }

    90% {
        clip: rect(10px, 9999px, 50px, 0);
    }

    95% {
        clip: rect(50px, 9999px, 90px, 0);
    }

    100% {
        clip: rect(30px, 9999px, 20px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(10px, 9999px, 80px, 0);
    }

    5% {
        clip: rect(90px, 9999px, 20px, 0);
    }

    10% {
        clip: rect(50px, 9999px, 50px, 0);
    }

    15% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    20% {
        clip: rect(60px, 9999px, 70px, 0);
    }

    25% {
        clip: rect(20px, 9999px, 10px, 0);
    }

    30% {
        clip: rect(80px, 9999px, 50px, 0);
    }

    35% {
        clip: rect(10px, 9999px, 90px, 0);
    }

    40% {
        clip: rect(40px, 9999px, 20px, 0);
    }

    45% {
        clip: rect(70px, 9999px, 60px, 0);
    }

    50% {
        clip: rect(30px, 9999px, 40px, 0);
    }

    55% {
        clip: rect(90px, 9999px, 10px, 0);
    }

    60% {
        clip: rect(20px, 9999px, 80px, 0);
    }

    65% {
        clip: rect(60px, 9999px, 30px, 0);
    }

    70% {
        clip: rect(10px, 9999px, 50px, 0);
    }

    75% {
        clip: rect(50px, 9999px, 90px, 0);
    }

    80% {
        clip: rect(30px, 9999px, 20px, 0);
    }

    85% {
        clip: rect(70px, 9999px, 90px, 0);
    }

    90% {
        clip: rect(20px, 9999px, 60px, 0);
    }

    95% {
        clip: rect(80px, 9999px, 5px, 0);
    }

    100% {
        clip: rect(10px, 9999px, 80px, 0);
    }
}

/* CRT Turn On Effect - Smooth Expansion */
.crt-turn-on {
    animation: turn-on 2.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    background-color: #0f0c29;
}

@keyframes turn-on {
    0% {
        transform: scale(1, 0.002);
        opacity: 0;
        filter: brightness(0);
    }

    10% {
        transform: scale(1, 0.002);
        opacity: 1;
        filter: brightness(3);
    }

    30% {
        transform: scale(1, 0.002);
        filter: brightness(5);
    }

    50% {
        transform: scale(1, 1);
        filter: brightness(1.5);
    }

    100% {
        transform: scale(1, 1);
        filter: brightness(1);
        opacity: 1;
    }
}

/* Add a subtle scanline moving down during boot */
.crt-turn-on::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(to bottom,
            rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
}

.crt-turn-on::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% {
        opacity: 0.05;
    }

    50% {
        opacity: 0.1;
    }

    100% {
        opacity: 0.05;
    }
}

/* Waves Background */
.waves-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50vh;
    z-index: 0;
    pointer-events: none;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background-repeat: repeat-x;
    background-position: 0 bottom;
    transform-origin: center bottom;
}

.wave1 {
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 320" xmlns="http://www.w3.org/2000/svg"><path fill="%2389b4fa" fill-opacity="0.3" d="M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: 50% 100%;
    animation: wave 20s linear infinite;
    z-index: 1;
    opacity: 0.7;
}

.wave2 {
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 320" xmlns="http://www.w3.org/2000/svg"><path fill="%23cba6f7" fill-opacity="0.3" d="M0,160L48,176C96,192,192,224,288,224C384,224,480,192,576,165.3C672,139,768,117,864,128C960,139,1056,181,1152,197.3C1248,213,1344,203,1392,197.3L1440,192V320H0Z"></path></svg>');
    background-size: 50% 100%;
    animation: wave 15s linear infinite reverse;
    z-index: 2;
    opacity: 0.5;
}

.wave3 {
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 320" xmlns="http://www.w3.org/2000/svg"><path fill="%23b4befe" fill-opacity="0.3" d="M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,224C672,245,768,267,864,261.3C960,256,1056,224,1152,202.7C1248,181,1344,171,1392,165.3L1440,160V320H0Z"></path></svg>');
    background-size: 50% 100%;
    animation: wave 10s linear infinite;
    z-index: 3;
    opacity: 0.3;
}

@keyframes wave {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Title Bar */
#title-bar {
    height: 32px;
    background-color: var(--ctp-mantle);
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid var(--ctp-surface0);
    position: relative;
    /* For absolute centering of title */
}

.window-controls {
    display: flex;
    gap: 8px;
    z-index: 2;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.close {
    background-color: var(--ctp-red);
}

.minimize {
    background-color: var(--ctp-yellow);
}

.maximize {
    background-color: var(--ctp-green);
}

.window-title {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--ctp-subtext0);
    font-size: 14px;
    font-weight: bold;
    user-select: none;
    pointer-events: none;
    /* Let clicks pass through title if needed */
    z-index: 1;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    gap: 12px;
    z-index: 2;
    /* Ensure buttons are clickable above title */
    margin-left: auto;
    /* Push to right */
}


.nav-btn,
.music-btn {
    background: none;
    border: none;
    color: var(--ctp-subtext0);
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
    border-radius: 4px;
}

.nav-btn:hover,
.music-btn:hover {
    color: var(--ctp-mauve);
    background-color: var(--ctp-surface0);
}

#music-toggle {
    margin-right: 10px;
    color: var(--ctp-subtext0);
}

#music-toggle:hover {
    color: var(--ctp-green);
}

.music-playing {
    color: var(--ctp-green) !important;
    animation: pulse-music 2s infinite;
}

@keyframes pulse-music {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}


/* Content Area */
#content-area {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    color: var(--ctp-text);
    font-family: 'Fira Code', monospace;
    position: relative;
}

/* Scrollbar Styling */
#content-area::-webkit-scrollbar {
    width: 8px;
}

#content-area::-webkit-scrollbar-track {
    background: var(--ctp-base);
}

#content-area::-webkit-scrollbar-thumb {
    background: var(--ctp-surface1);
    border-radius: 4px;
}

#content-area::-webkit-scrollbar-thumb:hover {
    background: var(--ctp-surface2);
}

/* Sections */
.section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.active-section {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.section-header {
    color: var(--ctp-green);
    font-weight: bold;
    margin-bottom: 20px;
    border-bottom: 1px dashed var(--ctp-surface1);
    padding-bottom: 10px;
}

/* Home Section & ASCII Art */
#ascii-art-container {
    font-family: monospace;
    font-size: 6px;
    /* Tiny font for ASCII art */
    line-height: 1;
    /* Tight line height */
    white-space: pre;
    overflow-x: hidden;
    /* Prevent scroll if it's slightly too wide */
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.intro-text {
    text-align: center;
    color: var(--ctp-subtext0);
    font-size: 16px;
    margin-top: 20px;
}

/* Projects Grid */
#projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: var(--ctp-surface0);
    border: 1px solid var(--ctp-surface1);
    padding: 15px;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: var(--ctp-mauve);
}

.project-name {
    color: var(--ctp-blue);
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.project-desc {
    color: var(--ctp-subtext0);
    font-size: 0.9em;
    margin-bottom: 12px;
}

.project-link {
    color: var(--ctp-rosewater);
    text-decoration: none;
    font-size: 0.85em;
}

.project-link:hover {
    text-decoration: underline;
}

/* About & Contact */
#about-content,
#contact-content {
    line-height: 1.6;
    max-width: 800px;
}

.contact-item {
    margin-bottom: 10px;
}

.contact-label {
    color: var(--ctp-yellow);
    display: inline-block;
    width: 100px;
}

/* Nav Button Active State */
.nav-btn.active {
    color: var(--ctp-base);
    background-color: var(--ctp-mauve);
    font-weight: bold;
}

/* Media Modal */
#media-modal {
    display: none;
    /* Hidden by default */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 50;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#media-content {
    max-width: 90%;
    max-height: 80%;
    border: 2px solid var(--ctp-lavender);
    border-radius: 8px;
    box-shadow: 0 0 20px var(--ctp-lavender);
    background-color: var(--ctp-base);
    overflow: auto;
    padding: 20px;
}

#media-content pre {
    margin: 0;
    font-family: 'Fira Code', monospace;
    color: var(--ctp-text);
    font-size: 14px;
}


#close-media-btn {
    margin-top: 16px;
    padding: 8px 16px;
    background-color: var(--ctp-red);
    color: var(--ctp-base);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    font-weight: bold;
    transition: background-color 0.2s;
}

#close-media-btn:hover {
    background-color: #ffadbf;
}

/* Resume Button */
.resume-btn {
    display: inline-block;
    background-color: var(--ctp-mauve);
    color: var(--ctp-base);
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2em;
    transition: transform 0.2s, background-color 0.2s;
    margin-top: 20px;
}

.resume-btn:hover {
    transform: scale(1.05);
    background-color: var(--ctp-lavender);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Project Explorer - GitHub Style */
#project-explorer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--ctp-base);
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.explorer-header {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--ctp-surface0);
    padding: 0;
    background: var(--ctp-mantle);
}

.explorer-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--ctp-surface0);
}

.explorer-repo-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.explorer-repo-icon {
    color: var(--ctp-overlay0);
    font-size: 1.2em;
}

.explorer-repo-name {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--ctp-blue);
}

.explorer-visibility {
    background: var(--ctp-surface0);
    color: var(--ctp-overlay0);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    border: 1px solid var(--ctp-surface1);
}

#explorer-exit-btn {
    background-color: var(--ctp-red);
    color: var(--ctp-base);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

#explorer-exit-btn:hover {
    background-color: #f5a9b8;
    transform: translateY(-1px);
}

.explorer-tabs {
    display: flex;
    gap: 0;
    padding: 0 20px;
}

.explorer-tab {
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--ctp-subtext0);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9em;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.explorer-tab:hover {
    color: var(--ctp-text);
    background: var(--ctp-surface0);
}

.explorer-tab.active {
    color: var(--ctp-text);
    border-bottom-color: var(--ctp-peach);
}

.explorer-tab i {
    margin-right: 6px;
}

.explorer-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.explorer-sidebar {
    width: 300px;
    border-right: 1px solid var(--ctp-surface0);
    overflow-y: auto;
    background: var(--ctp-mantle);
}

.explorer-sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ctp-surface0);
    background: var(--ctp-base);
    font-weight: 600;
    color: var(--ctp-text);
    font-size: 0.9em;
}

#explorer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.file-item {
    padding: 8px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--ctp-surface0);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease;
}

.file-item:hover {
    background-color: var(--ctp-surface0);
}

.file-icon {
    width: 16px;
    min-width: 16px;
    text-align: center;
    font-size: 0.9em;
}

.dir-icon {
    color: var(--ctp-blue);
}

.file-icon-text {
    color: var(--ctp-text);
    /* flex: 1; Removed to fix alignment */
    font-size: 0.9em;
}

.file-item-name {
    flex: 1;
    color: var(--ctp-text);
    font-size: 0.9em;
}

/* README Display */
.readme-container {
    max-width: 900px;
    margin: 0 auto;
}

.readme-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--ctp-mantle);
    border: 1px solid var(--ctp-surface0);
    border-radius: 6px 6px 0 0;
    margin-bottom: 0;
}

.readme-header i {
    color: var(--ctp-text);
}

.readme-header span {
    font-weight: 600;
    color: var(--ctp-text);
}

.readme-content {
    background: var(--ctp-mantle);
    border: 1px solid var(--ctp-surface0);
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 30px;
    color: var(--ctp-text);
    line-height: 1.6;
}

.readme-content h1,
.readme-content h2,
.readme-content h3 {
    color: var(--ctp-blue);
    border-bottom: 1px solid var(--ctp-surface0);
    padding-bottom: 8px;
    margin-top: 24px;
    margin-bottom: 16px;
}

.readme-content h1 {
    font-size: 2em;
}

.readme-content h2 {
    font-size: 1.5em;
}

.readme-content h3 {
    font-size: 1.2em;
}

.readme-content p {
    margin-bottom: 16px;
}

.readme-content code {
    background: var(--ctp-surface0);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    color: var(--ctp-mauve);
}

.readme-content pre {
    background: var(--ctp-surface0);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.readme-content pre code {
    background: none;
    padding: 0;
    color: var(--ctp-text);
}

.readme-content ul,
.readme-content ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.readme-content li {
    margin-bottom: 8px;
}

.readme-content a {
    color: var(--ctp-blue);
    text-decoration: none;
}

.readme-content a:hover {
    text-decoration: underline;
}

/* About Section */
.about-container {
    max-width: 600px;
}

.about-card {
    background: var(--ctp-mantle);
    border: 1px solid var(--ctp-surface0);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 16px;
}

.about-card h3 {
    color: var(--ctp-blue);
    margin-bottom: 12px;
    font-size: 1.1em;
}

.about-card p {
    color: var(--ctp-text);
    line-height: 1.6;
    margin-bottom: 12px;
}

.about-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ctp-subtext0);
    margin-bottom: 8px;
}

.about-stat i {
    color: var(--ctp-overlay0);
    width: 20px;
}

.about-badge {
    display: inline-block;
    background: var(--ctp-surface0);
    color: var(--ctp-text);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    border: 1px solid var(--ctp-surface1);
    margin-right: 6px;
    margin-bottom: 6px;
}

/* Dev Section */
.dev-update {
    background-color: var(--ctp-surface0);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--ctp-green);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dev-update:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-left-color: var(--ctp-mauve);
}

.dev-date {
    color: var(--ctp-subtext0);
    font-size: 0.8em;
    margin-bottom: 5px;
    font-style: italic;
}

.dev-title {
    color: var(--ctp-mauve);
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.dev-desc {
    color: var(--ctp-text);
}


/* Section Divider */
.section-divider {
    height: 1px;
    background-color: var(--ctp-surface1);
    margin: 30px 0;
}

/* Scrollbar hiding for xterm - kept for legacy if needed */
.xterm .xterm-viewport {
    overflow-y: hidden !important;
}

/* Neofetch Layout */
.neofetch-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    /* Vertically center content */
    gap: 40px;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 500px;
    /* Ensure good vertical spacing */
}

.neofetch-art {
    flex: 0 0 35%;
    /* Fixed 35% width for better balance */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px;
}

.flip-card {
    width: 100%;
    max-width: 300px;
    height: 300px;
    /* Fixed height for flip consistency */
    perspective: 1000px;
    margin-bottom: 20px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    cursor: pointer;
}

/* Flip on click (handled by JS toggling class) or hover if preferred. 
   User asked for "when u press it", so we'll use a class toggle in JS. 
   For now, let's add the transform rule for the class. */
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flip-card-front {
    background-color: transparent;
}

.flip-card-back {
    background-color: var(--ctp-mantle);
    color: var(--ctp-mauve);
    transform: rotateY(180deg);
    border: 3px solid var(--ctp-lavender);
    box-shadow: 0 0 40px rgba(137, 180, 250, 0.4);
    font-size: 1.5em;
    font-weight: bold;
    font-family: 'Fira Code', monospace;
}

#home-profile-img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(137, 180, 250, 0.4), 0 0 80px rgba(180, 190, 254, 0.2);
    border: 3px solid var(--ctp-lavender);
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Responsive Design */
@media (max-width: 900px) {
    .neofetch-layout {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 30px;
    }

    .neofetch-art {
        width: 100%;
        margin-bottom: 20px;
    }

    .neofetch-info {
        width: 100%;
    }

    #home-profile-img {
        max-width: 200px;
    }

    /* Override inline styles for mobile if needed, though inline usually wins. 
       We rely on the container centering. */
}

/* Active File Highlight */
.active-file {
    background-color: var(--ctp-surface1) !important;
    border-left: 3px solid var(--ctp-mauve);
}

/* Code Viewer Styling */
.code-viewer-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--ctp-mantle);
    border: 1px solid var(--ctp-surface0);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.code-filename {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: var(--ctp-text);
}

.code-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.code-lang {
    font-size: 0.8em;
    color: var(--ctp-overlay0);
    text-transform: uppercase;
}

.code-action-btn {
    color: var(--ctp-subtext0);
    font-size: 1.1em;
    transition: color 0.2s;
}

.code-action-btn:hover {
    color: var(--ctp-mauve);
}

.code-content {
    flex: 1;
    background: var(--ctp-mantle);
    border: 1px solid var(--ctp-surface0);
    border-radius: 0 0 6px 6px;
    padding: 0;
    overflow: auto;
}

.code-content pre {
    margin: 0;
    padding: 20px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    /* Wrap text */
    overflow-wrap: break-word;
    /* Standard property */
    word-wrap: break-word;
    /* Legacy support */
}

.code-content code {
    background: transparent !important;
    /* Override hljs background */
    padding: 0 !important;
}

.image-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--ctp-mantle);
    border: 1px solid var(--ctp-surface0);
    border-radius: 0 0 6px 6px;
    padding: 20px;
    overflow: auto;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 60vh;
    border: 2px solid var(--ctp-surface0);
    border-radius: 4px;
}

#home-profile-img:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 60px rgba(137, 180, 250, 0.6), 0 0 100px rgba(180, 190, 254, 0.3);
}

.profile-info {
    text-align: center;
    width: 100%;
}

.profile-name {
    font-size: 2em;
    font-weight: bold;
    color: var(--ctp-blue);
    margin: 0 0 8px 0;
    font-family: 'Fira Code', monospace;
}

.profile-subtitle {
    font-size: 0.95em;
    color: var(--ctp-overlay0);
    margin: 0 0 8px 0;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.profile-title {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--ctp-mauve);
    margin: 0 0 20px 0;
    font-family: 'Fira Code', monospace;
}

.contact-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--ctp-surface0);
    border: 2px solid var(--ctp-surface1);
    border-radius: 12px;
    color: var(--ctp-text);
    font-size: 1.5em;
    transition: all 0.3s ease;
    text-decoration: none;
}

.contact-icon:hover {
    background: var(--ctp-surface1);
    border-color: var(--ctp-lavender);
    color: var(--ctp-lavender);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 20px rgba(180, 190, 254, 0.3);
}

.contact-icon i {
    transition: transform 0.3s ease;
}

.contact-icon:hover i {
    transform: scale(1.1);
}

.neofetch-info {
    flex: 0 0 65%;
    /* Fixed 65% width */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 20px;
}

/* Adjust intro text alignment for neofetch layout */
.neofetch-info .intro-text {
    text-align: left;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.1em;
}

/* Adjust contact grid alignment */
.neofetch-info #home-contact-info {
    text-align: left;
}

/* Responsive for smaller screens */
/* Responsive Design - Mobile & Tablet Optimization */
@media (max-width: 900px) {

    /* Window Fullscreen on Mobile */
    #window {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }

    /* Adjust Title Bar */
    #title-bar {
        padding: 0 8px;
        height: 40px;
        /* Taller for touch */
    }

    .window-controls {
        display: none;
        /* Hide window controls on mobile */
    }

    .window-title {
        position: static;
        width: auto;
        margin-right: 15px;
        /* Add spacing */
        text-align: left;
        padding-left: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
        /* Prevent overlap */
    }

    .nav-buttons {
        gap: 5px;
    }

    .nav-btn {
        padding: 6px 8px;
        font-size: 11px;
    }

    /* Home Section / Neofetch */
    .neofetch-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 10px;
        gap: 20px;
    }

    .neofetch-art {
        flex: 0 0 auto;
        width: 100%;
        margin-bottom: 10px;
    }

    .flip-card {
        height: 250px;
        /* Smaller on mobile */
        max-width: 250px;
    }

    .neofetch-info {
        flex: 0 0 auto;
        width: 100%;
        padding-left: 0;
    }

    .neofetch-info .intro-text {
        text-align: center;
        font-size: 1em;
    }

    .profile-name {
        font-size: 1.6em;
    }

    .profile-title {
        font-size: 1em;
    }

    /* Force center alignment for injected content */
    .neofetch-info #home-contact-info div {
        text-align: center !important;
    }

    /* Projects Grid */
    #projects-grid {
        grid-template-columns: 1fr;
        /* Single column */
        padding: 10px;
    }

    /* Explorer Mobile Layout */
    .explorer-main {
        flex-direction: column;
        position: relative;
    }

    .explorer-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--ctp-surface0);
        height: 100%;
        /* Default to full height */
        position: absolute;
        z-index: 2;
        background: var(--ctp-mantle);
        transition: transform 0.3s ease;
    }

    /* When file is open, sidebar slides out or hides */
    .explorer-main.file-open .explorer-sidebar {
        transform: translateX(-100%);
    }

    #explorer-content {
        width: 100%;
        height: 100%;
        position: absolute;
        z-index: 1;
        background: var(--ctp-base);
    }

    /* Show content when file is open */
    .explorer-main.file-open #explorer-content {
        z-index: 3;
    }

    /* Mobile Back Button in Explorer */
    #explorer-mobile-back {
        display: inline-block !important;
    }

    /* Fix spacing between title and music button */
    .window-title {
        margin-right: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
        /* Prevent title from eating all space */
    }

    /* Explorer Header Mobile Layout */
    .explorer-top-bar {
        padding: 8px 12px;
    }

    .explorer-repo-info {
        flex: 1;
        min-width: 0;
        /* Allow truncation */
    }

    .explorer-repo-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 1.1em;
    }

    .explorer-visibility {
        display: none;
        /* Hide 'Public' badge on mobile */
    }

    /* Smaller Icon-Only Close Button */
    #explorer-exit-btn {
        padding: 8px;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 0;
        /* Hide text */
    }

    #explorer-exit-btn i {
        font-size: 16px;
        /* Show icon */
    }
}

/* Small Mobile Tweaks */
@media (max-width: 400px) {
    .nav-btn {
        font-size: 10px;
        padding: 4px 6px;
    }

    .profile-name {
        font-size: 1.4em;
    }
}

/* Mobile Back Button (Hidden by default) */
#explorer-mobile-back {
    display: none;
    margin-right: 10px;
    background: var(--ctp-surface0);
    border: none;
    color: var(--ctp-text);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}