:root {
    --bg-color: #0a0a0a;
    --sidebar-bg: #111111;
    --text-color: #e0e0e0;
    --text-muted: #666666;
    --accent: #ffffff;
    --hover-bg: #1a1a1a;
    --border-color: #222222;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

    /* Cat Variables */
    --cat-size: 2.2rem;
    /* ~35px */
    --cat-body: #161616;
    --cat-features: #fff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    /* Base reference for Desktop */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
    /* Explicitly set to 14px */
    line-height: 1.6;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 18rem;
    min-width: 18rem;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
}

.profile-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.name-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.name {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.03rem;
    color: var(--accent);
    margin-bottom: 0;
    white-space: nowrap;
}

.role {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.nav-group {
    flex-grow: 1;
}

.nav-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06rem;
}

.file-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* EXPLICIT GAP FOR ALL ITEMS */
}

.file-item {
    padding: 0.5rem 0.8rem;
    margin-bottom: 0;
    cursor: pointer;
    border-radius: 0.25rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.file-item:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

.file-item.active {
    background-color: var(--hover-bg);
    color: var(--accent);
    font-weight: 500;
}

.icon {
    font-weight: bold;
    font-size: 0.95rem;
    width: 1.5rem;
    text-align: center;
    opacity: 0.7;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.dot {
    width: 0.6rem;
    height: 0.6rem;
    background-color: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 0.4rem rgba(76, 175, 80, 0.5);
}

.snake-icon {
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.snake-icon:hover {
    opacity: 1;
    color: var(--accent);
    transform: scale(1.1);
}

/* Main Content */
.content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    position: relative;
    width: calc(100% - 18rem);
}

.tab-bar {
    height: 3rem;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: stretch;
    /* Stretch tabs to full height */
    padding: 0 1.8rem;
}

.tab {
    padding: 0 1.25rem;
    /* Remove vertical padding, use flex centering */
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-muted);
    border-top: 2px solid transparent;
    height: 100%;
    /* Full height */
}

.tab.active {
    color: var(--accent);
    border-top-color: var(--accent);
    background-color: var(--bg-color);
    /* Ensure it sits on top */
}

.editor-view {
    flex-grow: 1;
    padding: 2.5rem 3.125rem;
    overflow-y: auto;
    max-width: 75rem;

    /* Hide scrollbar for Chrome/Safari/Opera */
    &::-webkit-scrollbar {
        display: none;
        width: 0;
        background: transparent;
    }

    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Content Styling */
h1,
h2,
h3 {
    color: var(--accent);
    margin-bottom: 1.25rem;
    font-weight: 600;
}

h1 {
    font-size: 2rem;
}

h2 {
    margin-top: 2.5rem;
    font-size: 1.5rem;
}

h3 {
    margin-top: 1.8rem;
    font-size: 1.2rem;
}

p {
    margin-bottom: 1.25rem;
    color: #cccccc;
    font-size: 1rem;
    /* Line Highlight Effect */
    padding: 0.2rem 0.5rem;
    margin-left: -0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.1s;
}

p:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

a {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--text-muted);
    transition: border-color 0.2s;
}

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

/* Code Blocks / Lists */
.code-block {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    margin-bottom: 1.8rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.key {
    color: #9cdcfe;
}

.string {
    color: #ce9178;
}

.keyword {
    color: #569cd6;
}

.comment {
    color: #6a9955;
}

.number {
    color: #b5cea8;
}

ul.simple-list {
    list-style: none;
    margin-bottom: 1.8rem;
}

ul.simple-list li {
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
    position: relative;
    font-size: 0.95rem;
    /* Line Highlight Effect */
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    border-radius: 0.25rem;
}

ul.simple-list li:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

ul.simple-list li::before {
    content: ">";
    position: absolute;
    left: 0.2rem;
    color: var(--text-muted);
}

/* Skills Sections */
.skills-grid {
    display: block;
}

.yaml-section {
    margin-bottom: 1.8rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.yaml-section:last-child {
    border-bottom: none;
}

.yaml-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.6rem;
    padding-left: 1.25rem;
}

.yaml-items span {
    white-space: nowrap;
}

/* Project Cards (Minimal) */
.project-item {
    margin-bottom: 2.5rem;
    padding-bottom: 1.8rem;
    border-bottom: 1px solid var(--border-color);
    /* Line Highlight Effect */
    padding: 1rem;
    margin-left: -1rem;
    border-radius: 0.5rem;
    transition: background-color 0.1s;
}

.project-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.project-item:last-child {
    border-bottom: none;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.9rem;
}

.project-title {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: bold;
}

.project-links {
    font-size: 0.85rem;
}

.project-links a {
    margin-left: 1.25rem;
    color: var(--text-muted);
    border: none;
    white-space: nowrap;
    /* PREVENT TEXT WRAPPING */
}

.project-links a:hover {
    color: var(--accent);
}

.project-desc {
    color: #999;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.project-stack {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    html {
        font-size: 13px;
        /* Root scale */
    }

    body {
        font-size: 1rem;
        /* 13px */
        height: auto;
        overflow: auto;
    }

    .app-container {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .profile-header {
        margin-bottom: 1rem;
        /* Increased margin */
        display: flex;
        flex-direction: column;
        /* Stack vertically */
        align-items: center;
        /* Center horizontally */
        justify-content: center;
        text-align: center;
    }

    .name-wrapper {
        justify-content: center;
        /* Center name in wrapper */
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .name {
        font-size: 1.4rem;
        /* Slightly larger name */
    }

    /* Hide Desktop Elements */
    .cat,
    .status-indicator,
    .snake-icon,
    .nav-label {
        display: none !important;
    }

    .nav-group {
        display: block;
        margin-top: 0.25rem;
    }

    .file-list {
        display: flex;
        flex-direction: row;
        /* FORCE HORIZONTAL ROW */
        flex-wrap: nowrap;
        /* NO WRAPPING */
        overflow-x: auto;
        /* SCROLLABLE */
        gap: 0.5rem;
        padding-bottom: 0.25rem;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .file-list::-webkit-scrollbar {
        display: none;
    }

    .file-item {
        white-space: nowrap;
        background-color: var(--hover-bg);
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        margin-bottom: 0;
        border-radius: 0.25rem;
    }

    .content-area {
        width: 100%;
        height: auto;
    }

    .tab-bar {
        height: 2.5rem;
        padding: 0 1rem;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .tab {
        font-size: 0.9rem;
        padding: 0 1rem;
        /* Remove vertical padding */
    }

    .editor-view {
        padding: 1rem;
        height: auto;
        overflow: visible;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.2rem;
        margin-top: 1.5rem;
    }

    p,
    li {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    /* Mobile Project Header Fix */
    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .project-links {
        width: 100%;
        display: flex;
        gap: 1rem;
    }

    .project-links a {
        margin-left: 0;
        margin-right: 0.5rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #0a0a0a;
    border: 1px solid var(--border-color);
    padding: 2px;
    width: auto;
    box-shadow: 0 0 2rem rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.9rem;
    background-color: var(--hover-bg);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.close-modal {
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-muted);
}

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

#snakeCanvas {
    background-color: #111;
    display: block;
    border-bottom: 1px solid var(--border-color);
}

.game-controls {
    padding: 1.25rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background-color: var(--bg-color);
}

#startGameBtn {
    background-color: var(--accent);
    color: #000;
    border: none;
    padding: 0.5rem 1.25rem;
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    margin-top: 0.6rem;
    border-radius: 0.125rem;
    font-size: 1rem;
}

#startGameBtn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}


/* --- CAT ANIMATION (Updated) --- */
.cat {
    position: relative;
    height: var(--cat-size);
    width: calc(var(--cat-size) * 1.13);
    flex-shrink: 0;
}

/* Ears */
.ear {
    position: absolute;
    top: -30%;
    height: 60%;
    width: 25%;
    background: var(--cat-features);
}

.ear::before,
.ear::after {
    content: '';
    position: absolute;
    bottom: 24%;
    height: 10%;
    width: 5%;
    border-radius: 50%;
    background: var(--cat-body);
}

.ear::after {
    transform-origin: 50% 100%;
}

.ear--left {
    left: -7%;
    border-radius: 70% 30% 0% 0% / 100% 100% 0% 0%;
    transform: rotate(-15deg);
}

.ear--left::before,
.ear--left::after {
    right: 10%;
}

.ear--left::after {
    transform: rotate(-45deg);
}

.ear--right {
    right: -7%;
    border-radius: 30% 70% 0% 0% / 100% 100% 0% 0%;
    transform: rotate(15deg);
}

.ear--right::before,
.ear--right::after {
    left: 10%;
}

.ear--right::after {
    transform: rotate(45deg);
}

/* Face */
.face {
    position: absolute;
    height: 100%;
    width: 100%;
    background: var(--cat-body);
    border-radius: 50%;
}

/* Eyes */
.eye {
    position: absolute;
    top: 35%;
    height: 30%;
    width: 31%;
    background: var(--cat-features);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

/* Eyelids */
.eye::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 100%;
    border-radius: 0 0 50% 50% / 0 0 40% 40%;
    background: var(--cat-body);
    animation: cat-blink 4s infinite ease-in;
}

@keyframes cat-blink {
    0% {
        height: 0;
    }

    90% {
        height: 0;
    }

    92.5% {
        height: 100%;
    }

    95% {
        height: 0;
    }

    97.5% {
        height: 100%;
    }

    100% {
        height: 0;
    }
}

/* Tips of the eyes */
.eye::before {
    content: '';
    position: absolute;
    top: 60%;
    height: 10%;
    width: 15%;
    background: var(--cat-features);
    border-radius: 50%;
}

.eye--left {
    left: 0;
}

.eye--left::before {
    right: -5%;
}

.eye--right {
    right: 0;
}

.eye--right::before {
    left: -5%;
}

/* Pupils */
.eye-pupil {
    position: absolute;
    top: 25%;
    height: 50%;
    width: 20%;
    background: var(--cat-body);
    border-radius: 50%;
    animation: look-around 4s infinite;
}

@keyframes look-around {
    0% {
        transform: translate(0)
    }

    5% {
        transform: translate(50%, -25%)
    }

    10% {
        transform: translate(50%, -25%)
    }

    15% {
        transform: translate(-100%, -25%)
    }

    20% {
        transform: translate(-100%, -25%)
    }

    25% {
        transform: translate(0, 0)
    }

    100% {
        transform: translate(0, 0)
    }
}

.eye--left .eye-pupil {
    right: 30%;
}

.eye--right .eye-pupil {
    left: 30%;
}

/* Glare on the pupil */
.eye-pupil::after {
    content: '';
    position: absolute;
    top: 30%;
    right: -5%;
    height: 20%;
    width: 35%;
    border-radius: 50%;
    background: var(--cat-features);
}

/* Muzzle */
.muzzle {
    position: absolute;
    top: 60%;
    left: 50%;
    height: 6%;
    width: 10%;
    background: var(--cat-features);
    transform: translateX(-50%);
    border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%;
}
/* --- Mobile Resume Download Button --- */
.mobile-resume-download {
    display: none; /* Hidden by default (Desktop) */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--hover-bg);
    border: 1px dashed var(--border-color);
    border-radius: 0.5rem;
    text-align: center;
}

.download-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--accent);
    color: #000;
    font-weight: bold;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: transform 0.2s;
    border: none;
}

.download-btn:hover {
    transform: translateY(-2px);
    border: none;
}

@media (max-width: 768px) {
    .desktop-resume-view {
        display: none !important;
    }

    .mobile-resume-download {
        display: flex;
    }
}

@media (max-width: 768px) {
    .resume-header-desktop {
        display: none;
    }
}
