/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    background-color: #FFFFFF;
    color: #000000;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: #000000;
    display: inline-block;
    cursor: pointer;
    padding: 4px 8px; /* Background padding */
    transition: background-color 0.2s;
    position: relative; /* For z-index if needed */
    z-index: 2;
}

/* Header */
.site-header {
    padding: 30px 40px 10px 40px;
    margin-bottom: 20px;
    position: relative;
}

.site-header h1 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* The long black line under header */
.site-header::after {
    content: '';
    display: block;
    width: 100vw;
    height: 1px;
    background: #000;
    position: absolute;
    left: 0;
    bottom: 0;
}

/* Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: 250px 250px 1fr; /* Fixed widths */
    padding: 0 40px;
    position: relative; /* Context for SVG */
    min-height: 80vh;
}

/* SVG Overlay */
#connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; /* Behind text */
}

/* Sticky Navigation for First Two Columns */
.nav-column, .filter-column {
    position: sticky;
    top: 20px; /* Offset from top */
    align-self: start;
    height: fit-content;
}

/* Column Headers */
.column-header {
    font-size: 12px;
    font-weight: normal;
    color: #000;
    margin-bottom: 25px;
    padding-left: 0;
}

/* List Items */
.tree-list li, .project-item {
    margin-bottom: 15px; /* Spacing between items */
    position: relative;
    display: flex;
    align-items: baseline;
    z-index: 2;
    width: 100%;
}

.num {
    font-size: 11px;
    color: #999;
    width: 25px;
    margin-right: 5px;
    display: inline-block;
}

/* Active State */
.nav-link.active, .tag-link.active {
    background-color: #E0E0E0; /* Grey background */
}

/* Project List */
.project-item {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
}

.project-link {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: baseline;
}

.project-title {
    font-weight: normal;
    font-size: 15px;
}

.project-meta {
    display: inline-block;
    color: #999;
    font-size: 12px;
    margin-left: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-container {
        display: block;
        padding: 20px;
    }

    #connections-layer {
        display: none; /* Hide lines on mobile */
    }

    .column-header {
        margin-top: 20px;
    }

    .tree-list {
        margin-bottom: 20px;
    }

    .project-link {
        flex-direction: column;
    }

    .project-meta {
        margin-left: 0;
        margin-top: 4px;
    }
}
/* Grain Effect */
body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
    animation: grain 8s steps(10) infinite;
}

@keyframes grain {
  0%, 100% { transform:translate(0, 0) }
  10% { transform:translate(-5%, -10%) }
  20% { transform:translate(-15%, 5%) }
  30% { transform:translate(7%, -25%) }
  40% { transform:translate(-5%, 25%) }
  50% { transform:translate(-15%, 10%) }
  60% { transform:translate(15%, 0%) }
  70% { transform:translate(0%, 15%) }
  80% { transform:translate(3%, 35%) }
  90% { transform:translate(-10%, 10%) }
}
