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

#rain-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

body {
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

h1 {
    font-size: 4rem;
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    font-weight: lighter;

    width: max-content;
    margin: auto;
    margin-bottom: 2rem;

    text-decoration: underline solid lightgreen;

    transition: opacity 0.25s ease;
}

#index {
    max-width: 1200px;
    height: 100vh;
    margin: 0 auto;
    padding: 0 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#index-header {
    width: auto;
    margin: 0 0 1rem 0;
    text-decoration: underline solid lightgreen;
}

#nav {
    display: flex;
    flex-direction: column;
}

.link-container {
    margin-top: 1rem;
    width: max-content;
    padding-right: 10px;

    transition: 0.25s;
}

.link-container:hover {
    background-color: lightgreen;
}

.horizontal {
    width: 100vw;
}

.vertical {
    height: 100vh;
} 

#nav a {
    font-size: 2rem;
    text-decoration: none;
    color: black;

    width: max-content;
    margin-left: 0;
    transition: opacity 0.25s ease, margin-left 0.2s;
}

#nav a:hover {
    margin-left: 0.5rem;
}

.fade-out {
    opacity: 0;
    background-color: transparent;
    pointer-events: none;
    cursor: default;
}

#main {
    max-width: 1200px;
    height: 100vh;
    margin: auto;

    position: relative;

    
}

#back-button {
    position: fixed;
    z-index: 9999;

    margin-left: 2rem;
    margin-top: 1rem;

    width: max-content;

    font-size: 2rem;
    text-decoration: none;
    color: black;

    background-color: white;

    padding: 5px 10px;

    transition: opacity 0.25s ease, margin-left 0.2s;
}

#back-button:hover {
    margin-left: 3rem;
    background-color: lightgreen;
}

#main-header {
    padding-top: 5rem;

    margin-left: 2rem;
}

.section-subhead {
    font-size: 1rem;
    font-weight: lighter;
    font-style: italic;
    text-align: center;
    margin: 0.5rem auto;
    max-width: 700px;
    transition: opacity 0.25s ease;
}

.section-buttons {
    display: flex;
    gap: 1rem;
    margin-left: auto;
    margin-right: auto;
    margin-top: 2rem;
    margin-bottom: 1rem;
    justify-content: center;
    max-width: 1200px;
}

.section-btn {
    font-size: 1.5rem;
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    font-weight: lighter;
    padding: 0.5rem 1rem;
    background-color: white;
    color: black;
    border: 2px solid black;
    cursor: pointer;
    transition: 0.25s;
}

.section-btn:hover {
    border-color: lightgreen;
    color: lightgreen;
}

.section-btn.active {
    background-color: lightgreen;
    border-color: lightgreen;
    color: white;
}

.section-btn.active:hover {
    border-color: lightgreen;
}

.carousel-container {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
}


#wave-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.content-section, .carousel-nav, #section-subhead {
    position: relative;
    z-index: 1;
}

.content-section {
    display: flex;
    flex-direction: row;
    gap: 1rem;

    height: max-content;

    overflow-x: auto;
    overflow-y: visible;
    padding: 0.5rem 0;
    cursor: grab;
    user-select: none;
    
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    
    opacity: 1;
    transition: opacity 0.25s ease;
}

.content-section::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.content-card {
    width: 500px;
    height: 300px;

    background-color: white;
    border-radius: 1rem;
    border: 5px solid transparent;

    margin-bottom: 1rem;

    flex-shrink: 0;

    display: flex;
    flex-direction: column;
    font-size: 2rem;

    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));

    overflow: hidden;
    -webkit-user-drag: none;
    user-select: none;

    transition: transform 0.2s ease, border-color 0.2s ease;
}

.content-card:hover {
    transform: scale(1.03);
    border-color: lightgreen;
}

.card-image {
    flex: 1;
    background-size: cover;
    background-position: center;
    -webkit-user-drag: none;
    pointer-events: none;
}

.card-info-panel {
    height: 33.33%;
    flex-shrink: 0;

    background-color: white;
    padding: 0 1.25rem;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: black;
}

.card-description {
    font-size: 1rem;
    margin: 0;
    color: #333;
    line-height: 1.4;
}

#content {
    position: relative;
}

.carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.carousel-arrow-left,
.carousel-arrow-right {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    color: black;
    cursor: pointer;
    border: none;
    outline: none;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.carousel-arrow-left:hover,
.carousel-arrow-right:hover {
    background-color: lightgreen;
}

@media (max-width: 500px) {
    .content-section {
        /* Keep horizontal scroll on mobile */
        flex-direction: row;
    }

    .content-card {
        /* Make cards responsive to screen width on mobile */
        width: 80vw;
        min-width: 280px;
        height: auto;
        align-items: stretch;
    }

    .card-image {
        height: 55vw;
        min-height: 160px;
        flex: none;
    }

    .card-info-panel {
        height: auto;
        padding: 0.75rem 1rem;
    }

    #main-header {
        width: 100%;
        margin: 0px;
    }

    .header {
        margin-left: auto;
        margin-right: auto;
        width: max-content;
    }
    
    .carousel-arrow-left,
    .carousel-arrow-right {
        display: none;
    }
    
    .carousel-container {
        margin: 1rem 0;
    }
    
    .section-buttons {
        display: flex;
        justify-content: center;

        flex-direction: column;
        gap: 0.5rem;
        margin-left: 0px;
        padding: 0px 10px;
    }
    
    .section-btn {
        width: 100%;
    }

    #code-header {
        padding-top: 5rem;

        margin-left: 2rem;
    }

    .content-section {
        order: 1;
    }

    .carousel-nav {
        order: 2;
    }

    #section-subhead {
        order: 3;
        padding: 0.75rem 1.5rem;
    }
    
}
.fullscreen-carousel-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 340px);
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.fullscreen-carousel-container::-webkit-scrollbar {
    display: none;
}

.fullscreen-carousel {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.fullscreen-card {
    min-width: 100%;
    width: 100%;
    height: 100%;
    
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    
    background-color: white;
    border-radius: 1rem;
    
    font-size: 3rem;
    flex-shrink: 0;
    
    overflow: hidden;
}

/* For cards with just text (no image panel) */
.fullscreen-card:not(:has(.fullscreen-card-image)) {
    align-items: center;
    justify-content: center;
}

.fullscreen-arrow {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    color: black;
    cursor: pointer;
    border: none;
    outline: none;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.fullscreen-arrow:hover {
    background-color: lightgreen;
}

.carousel-indicators {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: auto;
}

.indicator {
    width: 15px;
    height: 15px;
    border-radius: 15%;
    transform: rotate(45deg);
    background-color: black;
    border: 2px solid white;
    cursor: pointer;
    transition: 0.3s;
}

.indicator.active {
    background-color: lightgreen;
    border: 2px solid lightgreen;
}
.fullscreen-card {
    display: flex;
    flex-direction: column;
}

.fullscreen-card-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

.fullscreen-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fullscreen-card-info {
    height: 33.33%;
    background-color: white;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
}

.fullscreen-card-info h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: black;
}

.fullscreen-card-info p {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    color: #333;
}

/* Binary rain canvas */
#binary-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* File Explorer */
.file-explorer {
    width: clamp(300px, 70vw, 900px);
    margin: 2rem auto;
    border: 2px solid black;
    border-radius: 8px;
    overflow: hidden;
    font-family: 'Trebuchet MS', Arial, sans-serif;
}

.file-explorer-titlebar {
    background-color: black;
    color: white;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.5rem 0.75rem;
}

.file-explorer-dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    transition: transform 0.1s ease;
}

.dot-red    { background-color: #ff5f57; }
.dot-yellow { background-color: #febc2e; }
.dot-green  { background-color: lightgreen; }

.file-explorer-title {
    font-size: 0.9rem;
    font-weight: lighter;
    text-align: center;
}

.file-explorer-body {
    background-color: white;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.15s;
}

.file-row:last-child { border-bottom: none; }

.file-row:hover {
    background-color: lightgreen;
}

.file-icon { font-size: 1.4rem; flex-shrink: 0; }

.file-name {
    font-size: 1.4rem;
    flex: 1;
}

.file-kind {
    font-size: 1.1rem;
    color: #888;
}

/* Project Window */
.project-window {
    position: fixed;
    top: 50%;
    left: 50%;
    width: clamp(320px, 60vw, 750px);
    max-height: 80vh;
    background: white;
    border: 2px solid black;
    border-radius: 8px;
    overflow: hidden;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
}

.project-window.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

.project-window.hidden { display: none; }

.project-window-titlebar {
    background-color: black;
    color: white;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    gap: 0.75rem;
    flex-shrink: 0;
}

.project-window-title {
    font-size: 0.9rem;
    font-weight: lighter;
    flex: 1;
    text-align: center;
}

.project-window-link {
    font-size: 0.85rem;
    color: lightgreen;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.project-window-link:hover { opacity: 0.7; }

.project-window-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
}

.project-window-body img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.project-window-info {
    padding: 1.25rem 1.5rem;
}

.project-window-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.project-window-info p {
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    margin: 0;
}

/* Graphics Gallery */
.graphics-gallery {
    max-width: 90vw;
    margin: 2rem auto;
    padding: 0 2rem 2rem;

    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.gallery-item {
    width: calc(33.333% - 0.75rem);
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fullscreen Viewer */
.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    
    transition: opacity 0.3s ease;
}

.fullscreen-viewer.active {
    opacity: 1;
    pointer-events: all;
}

.fullscreen-viewer img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.close-viewer {
    position: fixed;
    top: 2rem;
    right: 2rem;

    width: 60px;
    height: 60px;

    background-color: white;
    border: none;
    border-radius: 0;
    
    font-size: 3rem;
    line-height: 1;
    color: black;
    cursor: pointer;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    transition: background-color 0.2s;
    z-index: 1001;
}

.close-viewer:hover {
    background-color: lightgreen;
}

#viewer-prev {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#viewer-next {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 768px) {
    .gallery-item {
        width: calc(50% - 0.5rem);
    }
    
    .close-viewer {
        width: 50px;
        height: 50px;
        font-size: 2.5rem;
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 500px) {
    .gallery-item {
        width: 100%;
    }

    .graphics-gallery {
        padding: 0 1rem;
    }

    .section-subhead {
        padding: 0 1.25rem;
    }

    .file-explorer {
        width: auto;
        margin: 0 1rem;
    }

    .file-name  { font-size: 1rem; }
    .file-kind  { font-size: 0.8rem; }
    .file-icon  { font-size: 1rem; }

    .file-row {
        padding: 0.7rem 1rem;
    }

    .project-window {
        width: calc(100vw - 2rem);
        max-height: 90vh;
    }
}

@media (min-width: 1700px) {
    #main {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    #back-button {
        top: 1rem;
        left: 2rem;
        margin: 0;
    }

    #main-header {
        position: absolute;
        top: 3rem;
        left: 0;
        right: 0;
        padding-top: 0;
        text-align: center;
        margin-left: 0;
    }

    .section-buttons {
        justify-content: center;
    }

    .file-explorer {
        width: clamp(700px, 70vw, 1200px);
    }

    .file-row {
        padding: 1.2rem 2rem;
    }

    .file-icon { font-size: 2rem; }
    .file-name  { font-size: 2rem; }
    .file-kind  { font-size: 1.5rem; }

    .project-window {
        width: clamp(500px, 65vw, 1100px);
        max-height: 85vh;
    }

    .project-window-info h2 { font-size: 2.25rem; }
    .project-window-info p  { font-size: 1.5rem; }
}

/* Resume */
.resume-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin: 0 2rem;
}

.resume-embed {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 280px);
    object-fit: contain;


}

#resume-viewer-img {
    cursor: grab;
    user-select: none;
}

.resume-download {
    font-size: 1.5rem;
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    font-weight: lighter;
    padding: 0.5rem 2rem;
    background-color: black;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: 0.25s;
}

.resume-download:hover {
    color: lightgreen;
}