body {
    background-color: #0c0c0c;
    color: #666666;
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', monospace;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    padding: 60px;
}

a {
    color: #00ff00;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

a:hover {
    color: #66ff66;
    cursor: pointer;
}

main {
    max-width: 100%;
    width: 100%;
}

.project-listing-border {
    border-top: 1px solid #333333;
    margin-bottom: -1px;
}

h1 {
    color: #00ff00;
    font-size: 32px;
    margin: 0 0 8px 0;
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: -1px;
}
header h1 { margin-bottom:0; 
    display: inline-block;
}
header p { display: inline-block; }

p {
    color: #888888;
    margin: 0 0 30px 0;
    font-weight: 400;
    font-size: 14px;
}

.directory-listing {
    margin: 0 0 40px 0;
    border-top: 1px solid #333333;
}

.directory-header {
    display: grid;
    grid-template-columns: 120px 2fr 120px 56px 56px 56px;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid #333333;
    border-top: 1px solid #333333;
    margin-bottom: 8px;
    color: #666666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-entry {
    border-bottom: 1px solid #1a1a1a;
    transition: background-color 0.2s ease;
    margin-bottom: 0;
}

.project-entry:hover .project-row {
    background-color: #111111;
}

.project-entry.expanded .project-row {
    background-color: transparent;
}

.project-entry:last-child {
    border-bottom: none;
}

.project-row {
    display: grid;
    grid-template-columns: 120px 2fr 120px 56px 56px 56px;
    gap: 16px;
    padding: 12px 0;
    align-items: start;
}

.col-permissions {
    color: #888888;
    font-size: 12px;
}

.col-date {
    color: #888888;
    font-size: 12px;
}

.col-description {
    color: #666666;
    font-size: 12px;
}

.col-description a {
    color: #00ff00;
    text-decoration: none;
    transition: color 0.2s ease;
}

.col-description a:hover {
    color: #66ff66;
    text-decoration: underline;
}

.col-expand {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    color: #00ff00;
}

.expand-icon {
    transition: transform 0.3s ease, color 0.2s ease;
    width: 22px;
    height: 22px;
    margin-left: auto;
    margin-right: 0;
}

.project-entry.expanded .expand-icon {
    transform: rotate(180deg);
}



.project-link {
    color: #00ff00;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    cursor: pointer;
    display: inline-block;
    width: unset;
    max-width: 200px;
}

.project-link:hover {
    color: #66ff66;
    cursor: pointer;
}

.project-description {
    color: #666666;
    font-size: 12px;
    margin: 0;
}

.col-source,
.col-binary {
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-link {
    color: #888888;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: color 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    opacity: 1;
}

.icon-link.faded {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}


.icon-link:hover {
    color: #00ff00;
    cursor: pointer;
}

.icon-link svg {
    width: 16px;
    height: 16px;
}

.project-images {
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
   transition: max-height 0.6s cubic-bezier(.77,0,.18,1);
    width: 100%;
}

.project-entry.expanded .project-images {
    padding: 0;
    max-height: 6200px;
}


footer {
    padding-top: 40px;
    border-top: 1px solid #333333;
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-logos {
    display: flex;
    gap: 16px;
    align-items: center;
}
.site-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.site-footer-row .footer-socials {
    display: flex;
    gap: 16px;
    align-items: center;
}
.site-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}
.footer-left {
    display: flex;
    align-items: center;
    gap: 18px;
}
.footer-logos {
    display: flex;
    gap: 16px;
    align-items: center;
}
.footer-text {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.footer-socials {
    display: flex;
    gap: 16px;
    align-items: center;
}
.footer-socials img,
.footer-socials svg {
    filter: brightness(0) saturate(100%) invert(53%) sepia(3%) saturate(0%) hue-rotate(130deg) brightness(93%) contrast(87%);
    width: 30px;
    height: 30px;
    transition: filter 0.2s, color 0.2s, fill 0.2s;
}

.footer-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

footer p {
    color: #888888;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 0;
}

.logo-link {
    display: inline-block;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.logo-link:hover {
    filter: brightness(1.5);
    cursor: pointer;
}

.footer-social {
    display: inline-block;
    transition: filter 0.2s ease;
    cursor: pointer;
}
.footer-social:hover {
    filter: brightness(1.5);
    cursor: pointer;
}

.footer-logo {
    height: 32px;
    width: auto;
    filter: brightness(0) saturate(100%) invert(53%) sepia(3%) saturate(0%) hue-rotate(130deg) brightness(93%) contrast(87%);
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 20px;
        font-size: 14px;
    }
    h1 {
        font-size: 28px;
    }
    .directory-header {
        display: none;
    }
    .project-row {
        grid-template-columns: 1fr auto auto 40px;
        gap: 8px;
        padding: 12px 0;
    }
    .project-entry {
        border-bottom: 1px solid #333333;
    }
    .col-permissions,
    .col-date,
    .col-description {
        display: none;
    }
    .col-expand {
        display: flex;
        
    }
    .col-source,
    .col-binary {
        justify-content: flex-start;
    }
    .project-images {
        margin: 8px 0 24px 0;
        padding-bottom: 0;
    }
  

    footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .site-footer-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .footer-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .footer-logos {
        gap: 12px;
    }
    .footer-socials {
        margin-top: 8px;
        gap: 12px;
    }
}

@media (max-width: 768px) {

  .col-expand {
    flex: 0 0 40px;
    min-width: 40px;
    max-width: 40px;
  }
}

/* --- Modal Styles --- */
#media-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(8, 27, 4, 0.85);
    z-index: 99999;
    font-family: 'JetBrains Mono', 'Consolas', 'monospace';
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(.4,0,.2,1);
}
#media-modal.active {
    opacity: 1;
    pointer-events: auto;
}
#media-modal .retro-modal-window {
    background: #1c1c1c;
    border: 0;
    box-shadow: 0 0 0 1px #444, 0 8px 32px #000a;
    border-radius: 1px;
    min-width: 320px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto;
    position: relative;
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s cubic-bezier(.4,0,.2,1);
}
#media-modal.active .retro-modal-window {
    transform: scale(1);
    opacity: 1;
}
.retro-modal-titlebar {
    background: linear-gradient(90deg, #222 0%, #181c1b 100%);
    color: #9b9b9b;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.25em 0.7em;
    min-height: 1.7em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #444;
    -webkit-user-select: none;
    user-select: none;
}
.retro-modal-title {
    font-family: inherit;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80vw;
    color: #ddd;
    text-transform: lowercase;
}
.retro-modal-close {
    font-family: inherit;
    font-size: 1rem;
    color: #00ff00;
    background: #222;
    border: none;
    border-radius: 0;
    width: 1.6em;
    height: 1.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-left: 0.7em;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    border-left: 1px solid #444;
    border-bottom: 0;
}
.retro-modal-close:hover {
    background: #b9b9b9;
    color: #1c1c1c;
    border-left: 1px solid #444;
    border-bottom: 0;
}
#media-modal-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #181c1b;
    border-top: 1px solid #444;
}
#media-modal-content > img,
#media-modal-content > video {
    box-shadow: 0 0 0 1px #444, 0 4px 16px #000a;
    background: #181c1b;
    transition: none;
    opacity: 1;
    transform: none;
}

/* Cursor trail particle style */
.cursor-trail {
    position: fixed;
    width: 4px;
    height: 4px;
    background-color: #00ff00;
    pointer-events: none;
    z-index: 9999;
    border-radius: 0;
    opacity: 0.8;
    animation: trailFade 0.6s ease-out forwards;
}
@keyframes trailFade {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.3); }
}
.gallery-x-thumb {
  flex: 1 1 0;
  box-sizing: border-box;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #111111;
  border: 1px solid #444;
  font-family: inherit;
  font-size: 2.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: filter 0.3s cubic-bezier(.4,0,.2,1);
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.gallery-x-thumb:hover {
  filter: brightness(1.2);
}

.gallery-desc-thumb {
  position:relative; aspect-ratio: 1 / 1;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  flex: 1 1 0;
  max-width: calc(33.333% - 8px);
  box-sizing: border-box;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #111111;
  border: 1px solid #444;
  color: #888888;
  font-family: inherit;
  font-size: 0.85em;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  cursor: default;
  padding: 30px;
  text-align: left;
  transition: color 0.2s, filter 0.3s cubic-bezier(.4,0,.2,1);
  flex-direction: column; justify-content: flex-start; height: auto; max-height: 100vw;
}
    .gallery-desc-text {
        display: -webkit-box;
        -webkit-line-clamp: 9;
        line-clamp: 9;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

@media (max-width: 1024px) and (min-width: 601px) {
    .gallery-desc-text {
        display: -webkit-box;
        -webkit-line-clamp: 6;
        line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
.gallery-desc-thumb:hover {
  background: #1e1e1e; 
  color: #00ff00;
  filter: none;
}
.gallery-desc-thumb:hover .gallery-desc-name,
.gallery-desc-thumb:hover .gallery-desc-text {
  color: #00ff00;
}
.gallery-desc-thumb .launch-project-link { display:none; }

.gallery-desc-thumb:hover .launch-project-link {
    display:block;
    position: absolute;
    left: 2.4em;
    bottom: 2.4em;
    color: #00ff00;
    font-size: 1em;
    text-decoration: none;
    font-family: inherit;
    background: rgba(24,28,27,0.85);
    padding: 0.2em 0em;
    transition: background 0.15s, color 0.15s;
}
.gallery-desc-thumb:hover .launch-project-link:hover {
    background: #00ff00;
    color: #181c1b;
    text-decoration: underline;
}


.gallery-desc-name {
  color: #888888;
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.gallery-desc-text {
  color: #888888;
  font-size: 0.95em;
  font-weight: normal;
  margin: 0;
}


/* Video thumbnail overlay icon */
.video-thumb-container {
  position: relative;
  aspect-ratio: 1 / 1;
  background-color: #131313;
  border: 1px solid #444;
  overflow: hidden;
  cursor:pointer;
  flex: 1 1 0; 
  max-width: calc((100% - 2 * 30px) / 3); 
  aspect-ratio: 1 / 1; 
   min-width: 0;
  min-height: 0; 

}

.video-thumb {
  width: 100%;
  height: 100%;
  min-width:100%;
  min-height:100%;
  object-fit: cover;
  object-position: center;
  display:block;
  cursor:pointer;
}
.video-overlay-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.2s;
  width: 48px;
  height: 48px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-overlay-icon svg {
  width: 48px;
  height: 48px;
  fill: white;
}

.video-thumb-container:hover .video-overlay-icon {
  background-color: rgba(0, 255, 0, 0.7);

}
.video-thumb-container:hover .video-overlay-icon svg {
  width: 48px;
  height: 48px;
  fill: rgb(24, 24, 24);
}

.video-thumb-spinner.loader-spinner {
    position: absolute;
    left: 44%;
    top: 44%;
    transform: translate(-44%, -44%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.video-thumb-spinner.loader-spinner:empty {
    display: none;
}

.project-row { cursor:pointer; }

.icon-link.faded {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(1);
}
.icon-link:not(.faded):hover svg {
    filter: none;
    fill: #00ff00 !important;
    stroke: #00ff00 !important;
    transition: fill 0.15s, stroke 0.15s;
}

.gallery-row img,
.gallery-row video,
.gallery-desc-thumb {
  flex: 1 1 calc((100% - 2 * 30px) / 3);
  max-width: calc((100% - 2 * 30px) / 3);
  box-sizing: border-box;
  aspect-ratio: 1 / 1;
}
.gallery-row .video-thumb-container {
  flex: 1 1 calc((100% - 2 * 30px) / 3);
  max-width: calc((100% - 2 * 30px) / 3);
  box-sizing: border-box;
  aspect-ratio: 1 / 1;
}
.gallery-row .video-thumb {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-row img,
.gallery-row video {
  object-fit: cover;
  cursor:pointer;
  background-color: #171717;
  border: 1px solid #444;
}
.gallery-row img,
.gallery-row video,
.gallery-desc-thumb, 
.gallery-row .video-thumb-container .video-thumb {
  filter: grayscale(1) contrast(1) brightness(1);
  transition: filter 0.3s cubic-bezier(.4,0,.2,1);
}
.gallery-row img:hover,
.gallery-row .video-thumb-container:hover .video-thumb {
  filter: none;
}
.gallery-row {
  width:100%; display: flex; flex-wrap: wrap; gap: 30px; margin-bottom: 30px;
}
.gallery-image { width:100%; height:100%; flex: 1 1 calc((100% - 2 * 30px) / 3); max-width: calc((100% - 2 * 30px) / 3); aspect-ratio: 1 / 1; position: relative; }
.gallery-thumb { min-width:100%;min-height:100%;object-fit:cover;cursor:pointer; }

.project-gallery {
  padding: 20px 0 0 0;
}

@media (max-width: 600px) {
  .project-images {
    max-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: none;
  }
  .project-entry.expanded .project-images {
    display: block;
    max-height: none !important;
    height: auto !important;
    padding: 0;
    overflow: visible;
  }
  .gallery-row img,
  .gallery-row video,
  .gallery-row .video-thumb-container,
  .gallery-x-thumb {
    flex: 1 1 calc(50% - 6px);
    max-width: calc(50% - 6px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }
  .gallery-row .gallery-desc-thumb {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .gallery-row {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom:12px;
  }
  .gallery-image { max-width:100%; } 

  /* If only one thumb in row, make it 100% */
  .gallery-row img:only-child,
  .gallery-row video:only-child,
  .gallery-x-thumb:only-child {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .gallery-row img,
  .gallery-row .video-thumb-container {
    flex: 1 1 calc(50% - 6px);
    max-width: calc(50% - 6px);
  }
  
  /* If only one thumb in row, make it 100% */
  .gallery-row img:only-child,
  .gallery-row .video-thumb-container:only-child {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* New media query for screens between 601px and 768px */
@media (min-width: 601px) and (max-width: 768px) {
  .project-images {
    max-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: none;
  }
  .project-entry.expanded .project-images {
    display: block;
    max-height: none !important;
    height: auto !important;
    padding: 0;
    overflow: visible;
  }
}

/* Consistent project table header styling */
.project-table-header {
    font-size: 0.75em;
    font-weight: bold;
    border-bottom: 1px solid #444;
    letter-spacing: 0.03em;
    text-transform:uppercase;
    -webkit-user-select: none;
    user-select: none;
    font-family: 'JetBrains Mono', 'Consolas', 'monospace';
}
.project-table-header .col-permissions,
.project-table-header .col-date,
.project-table-header .col-name,
.project-table-header .col-description,
.project-table-header .col-source,
.project-table-header .col-binary,
.project-table-header .col-expand {
    font-size: inherit;
    color: inherit;
    font-family: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

.project-short-desc {
    font-size: 0.85em; 
}
.project-table .col-name.contents  { line-height:1.4; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.no-media-found { text-align:center; font-size: 0.65rem;
letter-spacing: 0.04em; color: #888;
padding: 20px;
background-color: #181c1b;
border: 1px solid #444;
margin-top: 10px;}

/* Simple spinner */
#media-modal-loader .loader-spinner { margin:40px; }
.loader-spinner {
  border: 4px solid #222;
  border-top: 4px solid #00ff00;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}