:root {
    --padding-x: 40px;
    --padding-y: 40px;
    --text-color: #000;
    --bg-color: #fafafa; /* Slightly greyed out base */
    --sidebar-bg: #f2f2f2; /* Slightly darker left side */
    --font-color-primary: #000; /* Primary font color */
    --font-color-secondary: #5d5d5d; /* Secondary font color (greyed out) */
    --font-family: "Inter", -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    --font-family-display: "Inter Display", "Inter", -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    --font-size: 14px;
    --line-height: 1.4;
    --gap: 20px;
}

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    
    /* Layout Logic */
    height: 100vh;
    overflow: hidden;
    padding: 0;
    
    /* V2 uses Flexbox defined in index.html, removing V1 Grid conflict */
    margin: 0;
}

/* Theme: Grey (Uniform) */
body.theme-grey {
    --bg-color: #f2f2f2;
    --sidebar-bg: #f2f2f2;
    /* Inherit text color #000 */
}

/* Theme: Dark */
body.theme-dark {
    --bg-color: #0f0f0f;
    --sidebar-bg: #0a0a0a;
    --text-color: #b0b0b0;
    --link-color: #e0e0e0;
    --font-color-primary: #fff;
    --font-color-secondary: #888;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    text-decoration: underline;
}

/* Fixed Sidebar */
.fixed-sidebar {
    /* Implicitly in column 1 */
    font-weight: normal;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align content to top */
    padding-top: var(--padding-y);
    padding-left: var(--padding-x);
    padding-right: var(--padding-x);
    padding-bottom: var(--padding-y);
    background-color: var(--sidebar-bg);
}

.fixed-sidebar h1 {
    font-size: var(--font-size);
    font-weight: normal;
    margin-bottom: 40px; /* Consistent gap to content */
}

.sidebar-subsections {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 32vh; /* Aligns with the vertical center of the first row of artifacts */
    margin-bottom: 0;
}

.sidebar-subsections a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sidebar-subsections a:hover,
.sidebar-subsections a.active {
    color: var(--text-color);
}

/* Scrollable Content Area */
.scroll-content {
    /* Implicitly in column 2 */
    overflow-y: auto;
    height: 100%;
    padding-top: var(--padding-y);
    padding-right: 60px;
    padding-bottom: var(--padding-y);
    padding-left: 60px;
    
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
    
    /* Internal Spacing */
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

/* Internal Grids (Nav, Text, Projects) */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3 columns inside the 3fr area */
    gap: var(--gap);
    width: 100%;
}

/* Navigation */
.nav-section {
    align-items: flex-start;
    padding-bottom: 80px; /* Space after nav */
}


.nav-title {
    margin-bottom: 0.5em;
}

.nav-subtitle {
    opacity: 0.6;
    line-height: 1.4;
}


/* Projects Section */
.projects-section {
    align-items: flex-start;
}

/* Section Captions */
.section-caption {
    grid-column: 1 / 4;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    margin-bottom: 20px;
    font-weight: normal;
}

body.theme-dark .section-caption {
    color: rgba(176, 176, 176, 0.6);
}

/* Notes Section */
.notes-section {
    margin-top: 80px;
}

.notes-container {
    grid-column: 1 / 4; /* Span all columns */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    width: 100%;
    column-gap: var(--gap);
}

.note-item {
    width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
    gap: 8px;
    margin-bottom: 8px;
}


.note-item {
    text-decoration: none;
}

.note-item:hover {
    background-color: #f9f9f9;
    text-decoration: none;
}

.note-item:hover .note-title {
    text-decoration: underline;
}

.note-item:hover .note-date {
    text-decoration: none;
}

.note-date {
    font-size: 14px;
    color: #999;
    font-weight: normal;
    white-space: nowrap;
    flex-shrink: 0;
}

.note-title {
    font-size: 14px;
    color: var(--text-color);
    font-weight: normal;
    flex: 1;
    min-width: 0;
}

body.theme-dark .note-item:hover {
    background-color: #1a1a1a;
}

body.theme-dark .note-date {
    color: #666;
}

body.theme-dark .note-item::after {
    color: var(--text-color);
}

/* Artifacts Section */
.artifacts-section {
    margin-top: 80px;
}

.artifacts-section .section-caption {
    margin-bottom: 20px;
}

.artifacts-container {
    grid-column: 1 / 4; /* Span all columns */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

.artifact-card.filler {
    background-color: #e5e5e5;
    cursor: default;
}

.artifact-card.filler::before {
    display: none; /* Remove hover overlay for filler boxes */
}

.artifact-card {
    width: 100%;
    background-color: #fff;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1 / 1; /* Fully square */
    transition: opacity 0.2s ease;
}

.artifact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
    pointer-events: none;
}

.artifact-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.artifact-card:hover .artifact-overlay {
    opacity: 1;
}

.artifact-card:hover::before {
    opacity: 1;
}

.artifact-preview-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover; /* Fill the square box */
    background-color: #f9f9f9; /* Light background for transparency */
}

.artifact-preview-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artifact-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    color: #fff;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.artifact-card:hover .artifact-description {
    opacity: 1;
}


/* Fullscreen Artifact Modal */
.artifact-fullscreen-modal {
    display: none;
    position: fixed;
    top: 60px; /* Below top bar (approximate height with padding) */
    left: 252px; /* Start after sidebar width */
    width: calc(100% - 252px); /* Full width minus sidebar */
    height: calc(100vh - 60px); /* Full viewport height minus top bar */
    z-index: 2000 !important; /* Above backdrop (1999) */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
    transform: none; /* Remove transform to avoid creating positioning context */
    isolation: isolate; /* Create new stacking context */
}

.artifact-fullscreen-modal.active {
    display: flex;
}

.artifact-modal-backdrop {
    position: fixed !important; /* Ensure fixed positioning relative to viewport */
    top: 0 !important; /* Start from top of viewport */
    left: 252px !important; /* Start after sidebar (viewport-relative) */
    right: 0 !important; /* Extend to right edge of viewport */
    width: auto !important; /* Let right:0 handle width */
    height: 100vh !important; /* Full viewport height */
    margin: 0 !important; /* Remove any margins */
    padding: 0 !important; /* Remove any padding */
    background-color: rgba(0, 0, 0, 0.8) !important; /* Dark backdrop - show immediately */
    backdrop-filter: blur(20px); /* Blur the background */
    -webkit-backdrop-filter: blur(20px);
    z-index: 1999 !important; /* Below modal (2000) but above content */
    will-change: backdrop-filter, opacity; /* Optimize for backdrop filter rendering */
    transform: translateZ(0); /* Force GPU acceleration */
    box-sizing: border-box; /* Include padding/border in width */
    pointer-events: auto; /* Allow clicks to pass through to backdrop for closing */
    /* Note: display is controlled by inline style, not CSS */
}

.artifact-modal-content {
    position: relative;
    z-index: 2001 !important; /* Above backdrop (1999) */
    background-color: transparent; /* No white background */
    padding: 0; /* No padding - image fills full box */
    max-width: 80vw; /* Increased width */
    max-height: 90vh; /* Increased height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: none; /* Removed shadow since content is transparent */
    overflow: visible; /* Allow description to be visible */
}

.artifact-modal-content img {
    max-width: 100%;
    max-height: 70vh; /* Limit image height to leave space for description */
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5); /* Shadow on image instead */
}

.artifact-modal-content video {
    max-width: 100%;
    max-height: 70vh; /* Limit video height to leave space for description */
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5); /* Shadow on video instead */
}

.artifact-modal-desc {
    margin-top: 24px;
    padding: 0;
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    max-width: 600px;
    font-family: "Montreal Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.artifact-modal-close {
    position: relative;
    margin-top: 20px;
    padding: 10px 24px;
    background-color: rgba(200, 200, 200, 0.6);
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease;
    z-index: 2002;
    font-family: var(--font-family);
}

.artifact-modal-close:hover {
    background-color: rgba(180, 180, 180, 0.8);
}


/* Add spacing between project sections */
#uiux {
    margin-top: 0; /* First section after nav */
}

.projects-column {
    display: flex;
    flex-direction: column;
    gap: var(--gap); /* Match horizontal spacing */
}

.project-card {
    width: 100%;
    background-color: #e5e5e5; /* Fallback color */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0;
    aspect-ratio: 2/1; /* 2:1 aspect ratio */
    position: relative;
}

.case-study-label {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    font-weight: normal;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.theme-dark .case-study-label {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.project-sub-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
    margin-top: var(--gap);
}

.sub-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2/1;
}

.sub-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s ease;
}

.sub-image-wrapper.polymarket-image {
    cursor: pointer;
    overflow: hidden;
}

.sub-image-wrapper.polymarket-image:hover .sub-image {
    filter: blur(4px);
}

.sub-image-wrapper.polymarket-image::after {
    content: 'in progress';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: normal;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.sub-image-wrapper.polymarket-image:hover::after {
    opacity: 1;
}


/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 20px;
        overflow-y: auto;
        height: auto;
        display: block;
    }

    .new-sidebar {
        display: none; /* Hide sidebar on mobile for now */
    }

    .scroll-content {
        height: auto;
        overflow: visible;
        display: block;
        padding-bottom: 20px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 40px;
    }
}

/* ============================================
   Sidebar Styles (Shared Component)
   ============================================ */

/* New Sidebar Styles */
.new-sidebar {
    width: 252px;
    height: 100vh;
    background-color: #161616;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-right: 1px solid #222;
    flex-shrink: 0;
    position: relative;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: visible;
    padding: 24px 16px;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 32px;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    color: #ccc;
    width: 20px;
    height: 20px;
}

.sidebar-title {
    color: #a1a1a1;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin: 0;
    font-family: "Inter Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.nav-group {
    margin-bottom: 20px;
    flex-shrink: 0; /* Prevent nav groups from shrinking */
}

.nav-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    padding-left: 12px;
    font-weight: 300;
    letter-spacing: -0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    color: #999;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    gap: 12px;
    font-size: 14px;
    margin-bottom: 0px;
}

.nav-item span {
    transition: transform 0.35s ease;
    display: inline-block;
}

.nav-item:hover {
    background-color: #222;
    color: #999;
    text-decoration: none;
}

.nav-item:hover span {
    transform: translateX(-2px);
    transition: transform 0.35s ease;
    color: #999;
}

.nav-item.active {
    background-color: #2a2a2a;
    color: #fff;
}

.nav-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;

}
/* Nav Icon/Caret Logic Refactored */

/* Default State: Icon Visible, Caret Hidden */
.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.nav-caret {
    display: none;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    pointer-events: none;
    position: relative;
}

/* Hover on item: Hide Icon, Show Right Caret */
.nav-item:hover .nav-icon {
    display: none;
}

.nav-item:hover .nav-caret {
    display: flex;
}

/* Active State: Icon Visible, Caret Hidden (Show Right Caret on Hover) */
.nav-item.active .nav-icon {
    display: flex;
}

.nav-item.active:hover .nav-icon {
    display: none;
}

.nav-item.active .nav-caret {
    display: none;
}

.nav-item.active:hover .nav-caret {
    display: flex;
}

/* Caret Types */
.nav-caret svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    position: absolute;
}

.nav-item:hover .nav-caret {
    color: #999;
}


.external-icon {
    margin-left: auto;
    opacity: 0.3;
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.nav-item:hover .external-icon {
    opacity: 0.6;
}

.about-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background-color: transparent;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #999;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.about-item:hover {
    background-color: #222;
    color: #ddd;
    text-decoration: none;
}

.about-item:hover .profile-img {
    visibility: hidden;
}

.about-item.active {
    background-color: #2a2a2a;
    color: #fff;
}

.about-item.active:hover .profile-img {
    visibility: visible;
}

.about-caret {
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: absolute;
    left: 12px;
    pointer-events: none;
}

.about-item:hover .about-caret {
    display: flex;
}

.about-item.active:hover .about-caret {
    display: none;
}

.about-caret svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.profile-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #444;
    object-fit: cover;
    flex-shrink: 0;
}

.footer-copyright {
    margin-top: 0;
    padding: 24px 16px;
    padding-left: 28px;
    padding-bottom: 24px;
    font-size: 11px;
    color: #444;
    flex-shrink: 0; /* Prevent footer from shrinking */
    line-height: 1.6;
    background-color: #161616;
}

/* Email Tooltip */
.email-tooltip {
    position: fixed;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background-color: #222;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 10000;
    margin-left: 8px;
}

.email-tooltip::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-right-color: #222;
}

.email-tooltip.show {
    opacity: 1 !important;
    transform: translateY(-50%) translateX(0) !important;
    visibility: visible !important;
}

#email-link {
    position: relative;
}

/* Custom Scrollbar for sidebar */
.new-sidebar::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* ============================================
   Top Bar Styles (Shared Component)
   ============================================ */

#topbar-container {
    position: sticky;
    top: 0;
    z-index: 3000; /* Above modal backdrop and content */
    width: 100%;
}

.top-bar {
    background-color: #161616;
    border-bottom: 1px solid #222;
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #999;
}

.breadcrumbs a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs a:hover {
    color: #fff;
}

.breadcrumbs .separator {
    color: #666;
    margin: 0 4px;
}

.breadcrumbs .current {
    color: #fff;
}

.copy-link-btn {
    background: none;
    border: 1px solid #333;
    color: #999;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-link-btn:hover {
    border-color: #555;
    color: #fff;
}

.copy-link-btn.copied {
    border-color: #4a9eff;
    color: #4a9eff;
}

/* ============================================
   Content Area Transitions
   ============================================ */

.project-content-area,
.content-area {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.project-content-area.fade-out,
.content-area.fade-out {
    opacity: 0;
}

.project-content-wrapper,
.content-area > div:not(#topbar-container) {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Prevent sidebar layout shift */
#sidebar-container {
    width: 252px;
    flex-shrink: 0;
    min-height: 100vh;
}

/* Smooth sidebar rendering */
#sidebar-container .new-sidebar {
    opacity: 1;
    transition: opacity 0.2s ease-in;
}

/* Content area fade transitions */
.project-content-wrapper {
    animation: fadeInContent 0.4s ease-in-out;
}

.content-area > div:not(#topbar-container) {
    animation: fadeInContent 0.4s ease-in-out;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Artifacts Grid */
.artifacts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 40px 80px 40px 80px;
    padding-bottom: 80px; /* Add bottom padding to ensure last row is fully visible */
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
}

@media (max-width: 1400px) {
    .artifacts-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 40px 60px;
    }
}

@media (max-width: 1100px) {
    .artifacts-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 40px 40px;
    }
}

/* V2 Artifacts - Override old v1 styles */
.artifacts-content .artifact-card {
    position: relative;
    aspect-ratio: 1/1;
    background-color: #1a1a1a !important;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.2s ease;
    width: 100%;
    min-width: 0; /* Critical for Grid to prevent overflow */
}

.artifacts-content .artifact-card::before {
    display: none; /* Remove old v1 overlay */
}

.artifacts-content .artifact-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artifacts-content .artifact-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.artifacts-content .artifact-card:hover .artifact-overlay {
    opacity: 1;
}

.artifacts-content .artifact-desc {
    font-size: 14px;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    font-weight: 400;
}

/* Blogs Section */
.blogs-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 800px;
}

.blog-bar {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background-color: #1a1a1a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.blog-bar:hover {
    background-color: #222;
    transform: translateX(4px);
}

.blog-date {
    font-size: 14px;
    color: #666;
    width: 100px;
    flex-shrink: 0;
}

.blog-title {
    font-size: 16px;
    color: #ddd;
    font-weight: 500;
}

.blog-bar:hover .blog-title {
    color: #fff;
}

/* Blog Modal */
.blog-modal {
    display: none;
    position: fixed;
    top: 45px; /* Below top bar */
    left: 252px; /* After sidebar */
    width: calc(100% - 252px); /* Full width minus sidebar */
    height: calc(100vh - 45px); /* Full height minus top bar */
    z-index: 200; /* Higher than desktop-window (z-index: 100) to appear above file finder */
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.blog-modal.active {
    display: flex;
}

.blog-modal .blog-window {
    pointer-events: auto;
}

.blog-modal::before {
    content: none;
}

.blog-window {
    width: 800px;
    max-width: 90vw;
    height: 80vh;
    max-height: 800px;
    background-color: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    cursor: default;
}

.blog-window[data-moved] {
    transform: none;
    transition: none;
}

.blog-modal.active .blog-window {
    transform: scale(1);
}

.blog-window.maximized {
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
    border-radius: 0;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    margin: 0 !important;
    position: absolute !important;
}

.window-header {
    height: 44px;
    background-color: #222;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: relative;
    flex-shrink: 0;
    cursor: grab;
    user-select: none;
}

.window-header:active {
    cursor: grabbing;
}

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

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
}

.control.close { background-color: #ff5f56; }
.control.minimize { background-color: #ffbd2e; }
.control.expand { background-color: #27c93f; }

.control:hover { filter: brightness(0.9); }

.window-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

.window-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    color: #ddd;
    font-size: 16px;
    line-height: 1.6;
}

.window-content h1 {
    font-size: 32px;
    color: #fff;
    margin-top: 0;
    margin-bottom: 8px;
    font-family: "Inter Display", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
}

.window-content .meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 40px;
}

.window-content p {
    margin-bottom: 20px;
    color: #ccc;
}

.window-content h3 {
    font-size: 20px;
    color: #fff;
    margin-top: 32px;
    margin-bottom: 16px;
    font-family: "Inter Display", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 500;
}

.window-content strong {
    font-family: "Inter Display", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
}

/* Scrollbar for modal */
.window-content::-webkit-scrollbar {
    width: 8px;
}

.window-content::-webkit-scrollbar-track {
    background: transparent;
}

.window-content::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 4px;
}


.artifacts-content {
    display: none;
    position: relative; /* Allow modal to position relative to this container */
    flex: 1; /* Fill available space in content-area */
    min-height: 100%; /* Fill the content area */
    overflow: visible; /* Allow content to expand beyond viewport for proper scrolling */
    background-color: #000; /* Ensure black background covers full area */
}

.artifacts-content.active {
    display: block;
}

:root {
    --font-family: "Inter Display", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --sidebar-width: 252px;
    --gap: 20px;
    --section-margin: 80px;
    --block-margin: 32px;
}

body {
    margin: 0;
    padding: 0;
    background-color: #0a0a0a;
    color: #fff;
    font-family: var(--font-family);
    overflow: hidden; /* Prevent body scroll, handle in content areas */
    height: 100vh;
    width: 100vw;
}

/* ============================================
   Desktop Environment Styles
   ============================================ */

.desktop-environment {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    background: url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?q=80&w=2564&auto=format&fit=crop') no-repeat center center;
    background-size: cover;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* System font for desktop look */
}

/* Desktop Overlay for tint/blur */
.desktop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* Slight darken */
    backdrop-filter: blur(0px);
    pointer-events: none;
}

/* Desktop Icons */
.desktop-icons {
    position: absolute;
    top: 40px;
    left: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 10;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px;
    transition: background-color 0.2s;
}

.desktop-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.desktop-icon:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.icon-image {
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.icon-label {
    color: #fff;
    font-size: 13px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

/* Desktop Window (Finder) */
.desktop-window {
    position: absolute;
    background-color: #1e1e1e; /* Dark theme finder */
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 600px;
    min-height: 400px;
    z-index: 100;
    transition: transform 0.1s, opacity 0.2s;
    animation: windowOpen 0.2s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.desktop-window.maximized {
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
    min-width: 0;
    min-height: 0;
    border-radius: 0;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    margin: 0 !important;
    position: absolute !important;
}

@keyframes windowOpen {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.window-header {
    height: 52px;
    background-color: #2a2a2a;
    border-bottom: 1px solid #000;
    display: flex;
    align-items: center;
    padding: 0 16px;
    user-select: none;
}

.window-controls {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
}

.control.close { background-color: #ff5f56; }
.control.minimize { background-color: #ffbd2e; }
.control.expand { background-color: #27c93f; }

.control:hover::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.1);
    border-radius: 50%;
}

.window-title {
    flex: 1;
    text-align: center;
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
    margin-right: 52px; /* Balance controls width */
}

.window-body {
    flex: 1;
    display: flex;
    background-color: #1e1e1e;
}

.window-sidebar {
    width: 180px;
    background-color: #252525; /* Sidebar slightly lighter/different */
    /* border-right: 1px solid #000; */
    padding: 12px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-group-title {
    padding: 8px 16px;
    font-size: 11px;
    color: #888;
    font-weight: 600;
}

.sidebar-item {
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    font-size: 13px;
    cursor: default;
}

.sidebar-item:hover {
    background-color: rgba(255,255,255,0.05);
}

.sidebar-item.active {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-item svg {
    opacity: 0.7;
}

.finder-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.finder-grid {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Finder List View Styles */
.finder-list-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #252525;
    border-bottom: 1px solid #333;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.finder-list-body {
    flex: 1;
    overflow-y: auto;
}

.list-column {
    padding: 0 8px;
    user-select: none;
    cursor: default;
}

.list-row {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background-color 0.15s ease;
    font-size: 13px;
    color: #ccc;
}

.list-row:hover {
    background-color: rgba(255,255,255,0.08);
}

.list-row:active {
    background-color: rgba(255,255,255,0.12);
}

.list-cell {
    padding: 0 8px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
    color: #999;
}

.list-name {
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-row:hover .list-name {
    color: #fff;
}

/* Legacy grid view styles (kept for compatibility) */
.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
}

.file-item:hover {
    background-color: rgba(255,255,255,0.1);
}

.file-item.selected {
    background-color: rgba(255,255,255,0.2);
}

.file-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    color: #ccc;
}

.file-name {
    font-size: 13px;
    color: #ccc;
    word-break: break-word;
    line-height: 1.3;
    max-width: 100%;
}
/* Finder List View Styles */
.finder-list-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #252525;
    border-bottom: 1px solid #333;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.finder-list-body {
    flex: 1;
    overflow-y: auto;
}

.list-column {
    padding: 0 8px;
    user-select: none;
    cursor: default;
}

.list-row {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background-color 0.15s ease;
    font-size: 13px;
    color: #ccc;
}

.list-row:hover {
    background-color: rgba(255,255,255,0.08);
}

.list-row:active {
    background-color: rgba(255,255,255,0.12);
}

.list-cell {
    padding: 0 8px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
    color: #999;
}

.list-name {
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-row:hover .list-name {
    color: #fff;
}

/* Mobile Block Overlay */
#mobile-block-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    box-sizing: border-box;
}

#mobile-block-overlay h2 {
    font-family: var(--font-family-display);
    font-size: 24px;
    margin-bottom: 16px;
    color: #fff;
}

#mobile-block-overlay p {
    font-family: var(--font-family);
    font-size: 16px;
    color: #999;
    line-height: 1.5;
    max-width: 400px;
}

@media (max-width: 768px) {
    #mobile-block-overlay {
        display: flex !important;
    }
    
    /* Hide main content when blocked */
    body > :not(#mobile-block-overlay) {
        display: none !important;
    }
}


/* DecryptedText Styles */
.decrypted-text {
    cursor: default;
}

.decrypted-text .encrypted {
    opacity: 0.8;
}

.decrypted-text .revealed {
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Terminal Styles */
.terminal-container {
    background-color: #000;
    color: #fff;
    font-family: var(--font-family);
    padding: 40px 80px;
    min-height: 100%; /* Ensure background covers full content height */
    width: 100%;
    box-sizing: border-box;
}

.terminal-content {
    max-width: 100%;
}

.terminal-text {
    color: #999;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
    font-family: var(--font-family);
}

.terminal-prompt-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    position: relative;
}

.terminal-prompt {
    color: #fff;
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    white-space: nowrap;
}

.terminal-input {
    flex: 1;
    background-color: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
    vertical-align: baseline;
}

.terminal-input::placeholder {
    color: transparent; /* Hide placeholder when suggestions are visible */
}

.terminal-container .artifacts-grid {
    margin-top: 40px;
    padding: 0;
    background-color: #000;
}

.terminal-container .artifact-card {
    background-color: #1a1a1a;
}

/* Terminal Input Suggestions */
.input-suggestions {
    position: absolute;
    left: 4px;
    top: 0;
    pointer-events: none;
    color: #999;
    font-size: 14px;
    font-family: var(--font-family);
    line-height: 1.5;
    opacity: 1;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    padding: 0;
    margin: 0;
}

.terminal-input:focus + .input-suggestions {
    opacity: 0;
}

.terminal-prompt-container {
    position: relative;
}
