: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: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 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;
    
    /* Grid for Fixed Sidebar + Content Area */
    display: grid;
    grid-template-columns: 1fr 4fr; /* Standardized 1:4 ratio */
    gap: 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 */
}

.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-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: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px 20px;
}

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

.artifact-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* Light backdrop like example */
    backdrop-filter: blur(20px); /* Blur the background */
    -webkit-backdrop-filter: blur(20px);
}

.artifact-modal-content {
    position: relative;
    z-index: 2001;
    background-color: transparent; /* No white background */
    padding: 0; /* No padding - image fills full box */
    max-width: 60vw; /* Smaller modal */
    max-height: 70vh; /* Smaller modal */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden; /* Clip image corners */
}

.artifact-modal-content img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.artifact-modal-content video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.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: Arial, sans-serif;
}

.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 {
        grid-template-columns: 1fr;
        padding: 20px;
        overflow-y: auto;
        height: auto;
        display: block;
    }

    .fixed-sidebar {
        margin-bottom: 40px;
        height: auto;
        display: block;
    }

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

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

