:root {
    --bg-color: #1e1e1e;
    --text-color: #f0f0f0;
    --header-bg: #2d2d2d;
    --header-text: #c0c0c0;
    --prompt-color: #76b900;
    /* Classic green or maybe a blue for zsh default */
    --command-color: #f0f0f0;
    --link-color: #4daafc;
    --link-hover: #8ac6fd;
    --cursor-color: #a0a0a0;
    --btn-color: #f0f0f0;
    --overlay-bg: rgba(30, 30, 30, 0.95);
    --code-bg: rgba(110, 118, 129, 0.4);
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #333333;
    --header-bg: #e0e0e0;
    --header-text: #555555;
    --prompt-color: #005cc5;
    --command-color: #333333;
    --link-color: #0366d6;
    --link-hover: #58a6ff;
    --cursor-color: #555555;
    --btn-color: #333333;
    --overlay-bg: rgba(255, 255, 255, 0.95);
    --code-bg: #f6f8fa;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.3s;
}

.page-content {
    margin-top: 60px;
    text-align: left;
    padding-left: 10%;
    padding-right: 10%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-color);
}

[data-theme="dark"] body {
    background-color: var(--bg-color);
}

/* Home page (terminal page) has contrasting background */
body.home-page {
    background-color: #f5f5f5;
}

[data-theme="dark"] body.home-page {
    background-color: #121212;
}

.theme-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    /* Fixed width for alignment */
    text-align: center;
    color: var(--btn-color);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2000;
    transition: color 0.3s, transform 0.3s;
}

.theme-btn:hover {
    transform: scale(1.1);
}

.terminal-container {
    width: 800px;
    max-width: 90%;
    background-color: var(--bg-color);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.terminal-header {
    background-color: var(--header-bg);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.buttons {
    display: flex;
    gap: 8px;
}

.buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.close {
    background-color: #ff5f56;
}

.minimize {
    background-color: #ffbd2e;
}

.maximize {
    background-color: #27c93f;
    cursor: default;
}

.title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--header-text);
    font-size: 0.9rem;
    font-weight: 500;
}

.terminal-body {
    padding: 20px;
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.5;
    min-height: 400px;
}

.command-line {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.prompt {
    color: var(--prompt-color);
    margin-right: 10px;
    font-weight: bold;
}

.command {
    color: var(--command-color);
}

.output {
    margin-bottom: 20px;
    padding-left: 0;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

.link-item:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 18px;
    background-color: var(--cursor-color);
    animation: blink 1s infinite;
    vertical-align: middle;
}

.cursor.typing {
    animation: none;
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* Full Page Styles */
.full-page {
    position: absolute;
    /* Changed from fixed to use document scrollbar */
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    /* Ensure it covers at least the viewport */
    background-color: var(--bg-color);
    color: var(--text-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 0;
    /* overflow-y: auto; <-- Removed to use body scroll */
    box-sizing: border-box;
}

.nav-menu {
    position: fixed;
    top: 70px;
    left: 20px;
    width: 30px;
    /* Match theme-btn width */
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.home-btn,
.menu-btn {
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.2s;
}

.home-btn:hover,
.menu-btn:hover {
    color: var(--link-color);
}

.page-content {
    margin-top: 60px;
    margin-bottom: 60px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 5%;
    padding-right: 5%;
    width: 800px;
    max-width: 90%;
    text-align: left;
}

/* Menu Dropdown */
.menu-container {
    position: relative;
}

.menu-dropdown {
    position: absolute;
    top: 0;
    left: 40px;
    /* Position to the right of the button */
    background-color: var(--bg-color);
    border: 1px solid var(--header-bg);
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: max-content;
    z-index: 2000;
}

.menu-link {
    font-size: 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
    text-align: left;
}

.menu-link:hover {
    color: var(--link-color);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@media (max-width: 600px) {
    .terminal-container {
        width: 95%;
        height: 90vh;
    }

    .page-content {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Blog Styles */
.blog-year {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: left;
    font-weight: bold;
}

.blog-item-compact {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 10px;
    text-align: left;
}

.blog-date {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    color: var(--header-text);
    min-width: 100px;
    text-align: left;
    font-size: 0.9rem;
}

.blog-title {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s;
}

.blog-title:hover {
    color: var(--link-color);
    text-decoration: underline;
}

/* Markdown Content Styles */
.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6 {
    color: var(--text-color);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.page-content p {
    margin-bottom: 1em;
    line-height: 1.6;
}

.page-content a {
    color: var(--link-color);
    text-decoration: none;
}

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

.page-content code {
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
}

.page-content pre {
    /* background-color: var(--header-bg); - Handled by syntax.css */
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1em;
}

.page-content pre code {
    background-color: transparent;
    padding: 0;
}

.page-content blockquote {
    border-left: 4px solid var(--link-color);
    margin: 0 0 1em 0;
    padding-left: 15px;
    color: var(--header-text);
    font-style: italic;
}

.page-content ul,
.page-content ol {
    margin-bottom: 1em;
    padding-left: 20px;
}

.page-content li {
    margin-bottom: 0.5em;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.page-content th,
.page-content td {
    border: 1px solid var(--header-bg);
    padding: 8px;
    text-align: left;
}

.page-content th {
    background-color: var(--header-bg);
    font-weight: bold;
}

/* Page Header Styles */
.page-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 2em;
    gap: 5px;
}

.page-header h1 {
    margin-top: 0;
    margin-bottom: 0;
    align-self: flex-start;
}

.page-date {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    color: var(--text-color);
    font-size: 0.9rem;
    align-self: flex-end;
}

/* About Me Styles */
.about-container {
    display: flex;
    gap: 30px;
    margin-top: 2em;
    flex-wrap: wrap;
}

.about-photo {
    flex: 0 0 200px;
}

.about-photo img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--link-color);
}

.about-bio {
    flex: 1;
    min-width: 300px;
}

.about-bio h2 {
    margin-top: 1.5em;
    color: var(--text-color);
}

.about-bio ul {
    list-style-type: none;
    padding-left: 0;
}

.about-bio ul li {
    padding: 0.5em 0;
    padding-left: 1.5em;
    position: relative;
}

.about-bio ul li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--link-color);
}

@media (max-width: 600px) {
    .about-container {
        flex-direction: column;
        align-items: center;
    }

    .about-photo {
        flex: 0 0 auto;
    }
}

/* Minimalist Projects List */
.page-content .minimalist-list {
    list-style-type: none;
    padding-left: 0;
    margin-left: 0;
    margin-top: 2rem;
}

.minimalist-list li {
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--text-color);
}

.minimalist-list .project-title {
    font-weight: bold;
    color: var(--link-color);
    text-decoration: none;
}

.minimalist-list .project-title:hover {
    text-decoration: underline;
}

.minimalist-list .project-separator {
    margin: 0 8px;
    color: var(--header-text);
}

.minimalist-list .project-description {
    color: var(--text-color);
}

/* Gallery Styles */
.gallery-content {
    max-width: 100% !important;
    /* Allow full width for random layout */
    padding: 0 20px;
    overflow-x: hidden;
}

.gallery-header {
    text-align: center;
    margin-bottom: 50px;
    margin-top: 20px;
}

.gallery-header h1 {
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 10px;
    font-family: 'Courier New', Courier, monospace;
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: var(--header-text);
    font-family: 'Courier New', Courier, monospace;
}

.photos-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    /* Ensure enough space */
    margin-top: 40px;
}

.gallery-photo {
    position: absolute;
    transition: transform 0.3s, z-index 0.3s, opacity 0.5s ease-in;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    will-change: transform, opacity;
}

.fade-in-hidden {
    opacity: 0;
}

.fade-in-visible {
    opacity: 1;
}

.gallery-photo:hover {
    transform: scale(1.05);
    z-index: 100 !important;
    /* Bring to front on hover */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.gallery-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Crop content */
    display: block;
    /* No border radius for squared look */
}

/* Lightbox Styles */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    animation: zoom 0.3s;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}