/* GENERAL STYLE  */

body {
    margin: 0;
    padding: 20px;
    font-family: 'Courier New', monospace;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

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

canvas:not(#fireworkCanvas):not(#trailCanvas) {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    cursor: auto;
    z-index: -1;
}

#fireworkCanvas,
#trailCanvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    pointer-events: none !important;
    background: transparent !important;
}
.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10;
    position: relative;
}

.ascii-header {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.ascii-art {
    font-size: 17px;
    line-height: 1.2;
    color: black;
    white-space: pre;
    margin: 0;
    transform-origin: top center;
    display: inline-block;
}

.ascii-art .char {
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.ascii-art .char.hover-effect {
    transform: scale(2.9);
    opacity: .5;
    position: relative;
}

.ascii-art .char.hover-effect-nearby {
    transform: scale(2.6);
    opacity: .7;
    position: relative;
}

/* NAV BAR STYLING */
#nav-bar {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

#nav-bar li a {
    display: block;
    padding: 16px 24px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.2s ease;
}

#nav-bar li a:hover {
    opacity: 0.5;
}

#nav-bar li.active a {
    color: #000;
    text-decoration: underline;
}

@media (max-width: 600px) {
    #nav-bar li a {
        padding: 12px 14px;
        font-size: 15px;
    }
}

@media (max-width: 400px) {
    #nav-bar li a {
        padding: 10px 10px;
        font-size: 14px;
    }
}

/* ============================================
   CAROUSEL & PROJECT STYLES (CONSOLIDATED)
   ============================================ */

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
}

.carousel-btn {
    color: black;
    background-color: white;
    border: none;
    padding: 60px 20px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    z-index: 20;
    position: relative;
    flex-shrink: 0;
}

.carousel-btn:hover {
    opacity: .7;
}

.carousel-btn:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.carousel-content {
    flex: 1;
    margin: 0 20px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.project-container {
    display: none;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.project-container.active {
    display: block;
}

.actual-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.canvas-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 10 !important;
    background: transparent !important;
}

.project-description {
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.typing-text {
    color: #333;
    font-size: clamp(12px, 2.5vw, 16px);
    line-height: 1.6;
    font-family: 'Courier New', monospace;
}

/* ASCII LINK STYLING */
.ascii-link {
    width: 100%;
    display: flex;
    justify-content: left;
    overflow: hidden;
    margin: 15px 0;
    min-height: 60px;
}

.ascii-link pre {
    font-size: 12px;
    line-height: 1.2;
    color: black;
    white-space: pre;
    margin: 0;
    transform-origin: top left;
    display: inline-block;
    font-family: 'Courier New', monospace;
}

.ascii-link .char {
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.ascii-link .char.hover-effect {
    transform: scale(2.9);
    opacity: .5;
    position: relative;
}

.ascii-link .char.hover-effect-nearby {
    transform: scale(2.6);
    opacity: .7;
    position: relative;
}

/* Swipe hint - hidden by default, shown on mobile */
.swipe-hint {
    display: none;
    text-align: center;
    font-size: 12px;
    color: #999;
    font-family: 'Courier New', monospace;
    padding: 15px 0;
    opacity: 0.7;
    width: 100%;
}

/* Dark mode carousel styles */
body.dark-mode .typing-text {
    color: #ccc;
}

body.dark-mode .carousel-btn {
    background: #000;
    color: #fff;
}

body.dark-mode .ascii-link pre {
    color: #fff;
}

body.dark-mode .swipe-hint {
    color: #666;
}

/* ============================================
   MOBILE CAROUSEL STYLES
   ============================================ */
@media (max-width: 768px) {
    .carousel-container {
        padding: 0 0 15px 0;
        flex-direction: column;
    }
    
    .carousel-btn {
        display: none !important;
    }
    
    .carousel-content {
        margin: 0;
        padding: 0 15px;
        width: 100%;
        box-sizing: border-box;
        transition: transform 0.1s ease-out;
    }
    
    .ascii-link {
        min-height: 50px;
    }
    
    .ascii-link pre {
        font-size: 9px;
    }
    
    .project-description {
        padding: 0 10px;
    }
    
    .typing-text {
        font-size: 13px;
        line-height: 1.5;
    }
    
    /* Show swipe hint on mobile */
    .swipe-hint {
        display: block;
    }
}

@media (max-width: 480px) {
    .carousel-content {
        padding: 0 10px;
    }
    
    .ascii-link pre {
        font-size: 7px;
    }
    
    .ascii-link {
        min-height: 40px;
    }
    
    .typing-text {
        font-size: 12px;
    }
}



/* NEW  */
/* ============================================
   THUMBNAIL GRID
   ============================================ */

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    padding: 0 20px 20px 20px;
}

.thumbnail-grid.hidden {
    display: none;
}

.thumbnail-item {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border: 1px dotted black;
}

.thumbnail-item:hover {
    transform: scale(1.03);
    opacity: 0.85;
}

.thumbnail-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    /* border: 12px dotted transparent; */
    padding: 12px 12px 0 12px;
    /* border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Ccircle cx='3' cy='3' r='1.5' fill='black'/%3E%3C/svg%3E") 30 round; */
}

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

.thumbnail-label {
    text-align: center;
    font-size: 14px;
    padding: 5px 0;
    color: black;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

/* Close button */
.carousel-close {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    background: white;
    border: 1px solid black;
    color: black;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    font-family: 'Courier New', monospace;
    padding: 8px 12px;
    transition: opacity 0.2s ease;
}

.carousel-close::before {
    content: '[ ';
}

.carousel-close::after {
    content: ' ]';
}

.carousel-close:hover {
    opacity: 0.6;
}

.carousel-close.visible {
    display: block;
}

/* Transition overlay */
.carousel-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-transition-overlay.active {
    opacity: 1;
}

/* Carousel wrapper */
.carousel-wrapper {
    display: none;
    align-items: center;
    width: 100%;
}

.carousel-wrapper.active {
    display: flex;
}

/* ============================================
   DARK MODE THUMBNAIL STYLES
   ============================================ */

body.dark-mode .thumbnail-image {
    /* background: #222; */
    /* border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Ccircle cx='3' cy='3' r='1.5' fill='white'/%3E%3C/svg%3E") 30 round; */
}

body.dark-mode .thumbnail-label {
    color: white;
}

body.dark-mode .carousel-close {
    background: black;
    border-color: white;
    color: white;
}

body.dark-mode .carousel-transition-overlay {
    background: black;
}

body.dark-mode .thumbnail-item{
    border: 1px dotted white;
}

/* ============================================
   RESPONSIVE THUMBNAIL STYLES
   ============================================ */

@media (max-width: 900px) {
    .thumbnail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 550px) {
    .thumbnail-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 10px 10px 10px;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .thumbnail-item {
        max-width: 100%;
    }
    
    .thumbnail-image {
        border-width: 10px;
    }
    
    .thumbnail-label {
        font-size: 11px;
        margin-top: 10px;
    }
    
    .carousel-close {
        top: 5px;
        left: 5px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* VISUAL PAGE STYLING  */
.design-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10;
    position: relative;
}



.image-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

@media (max-width: 700px) {
    .image-container {
        margin: 10px 0;
    }
}



.ripple-image {
    max-width: 100%;
    height: auto;
    display: block;
    visibility: hidden;
}

.ripple-image-canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.glitch1-image {
    max-width: 100%;
    height: auto;
    display: block;
    visibility: hidden;
}

.glitch1-image-canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.glitch2-image {
    max-width: 100%;
    height: auto;
    display: block;
    visibility: hidden;
}

.glitch2-image-canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.glitch3-image {
    max-width: 100%;
    height: auto;
    display: block;
    visibility: hidden;
}

.glitch3-image-canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.glitch4-image {
    max-width: 100%;
    height: auto;
    display: block;
    visibility: hidden;
}

.glitch4-image-canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.reactive-image {
    width: 100%;
    height: auto;
    display: block;
}

/* AUDIO STYLING  */
.players-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.waveform-player {
    width: 100%;
}

.waveform-player .header {
    font-size: 14px;
    margin-bottom: 15px;
    text-align: left;
}

.waveform-player .album-art {
    width: 100%;
    max-width: 400px;
    display: block;
    margin-bottom: 10px;
}

/* Update existing waveform styles */
.waveform-player .waveform-container {
    border: 1px solid #000;
    padding: 15px 5px;
    margin: 10px 0;
    cursor: pointer;
    background: #fff;
    overflow: hidden; /* Hide overflow from scaled chars */
}

.waveform-player .waveform {
    font-size: 8px; /* Smaller for more detail */
    line-height: 1.1;
    white-space: pre;
    user-select: none;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: 'VT323', monospace;
    letter-spacing: 0px;
    /* Remove pointer-events: none from here */
}

.waveform-player .waveform-line {
    display: block;
}

.waveform-player .waveform-char {
    display: inline-block;
    transition: transform 0.15s ease, opacity 0.15s ease;
    pointer-events: none;
}

/* Hover effects */
.waveform-player .waveform-char.hover-effect {
    transform: scale(2.5);
    opacity: 0.6;
    position: relative;
    z-index: 10;
}

.waveform-player .waveform-char.hover-effect-nearby {
    transform: scale(1.8);
    opacity: 0.75;
    position: relative;
    z-index: 5;
}

.waveform-player .waveform-char.hover-effect-far {
    transform: scale(1.3);
    opacity: 0.85;
    position: relative;
    z-index: 2;
}

.waveform-player .waveform span {
    pointer-events: none;
}

.waveform-player .played {
    background: #000;
    color: #fff;
}

.waveform-player .playhead {
    background: #000;
    color: #fff;
}

.waveform-player .status-bar {
    font-size: 16px;
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 8px 0;
}

.waveform-player .controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 15px 0;
}

.waveform-player .ascii-btn {
    background: #fff;
    border: 1px solid #000;
    color: #000;
    font-family: 'VT323', monospace;
    font-size: 16px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.1s;
}

.waveform-player .ascii-btn:hover {
    background: #000;
    color: #fff;
}

.waveform-player .ascii-btn:active {
    transform: scale(0.95);
}

.waveform-player .ascii-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.waveform-player .ascii-btn:disabled:hover {
    background: #fff;
    color: #000;
}

.waveform-player .volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

.waveform-player .ascii-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 6px;
    background: #fff;
    border: 1px solid #000;
    cursor: pointer;
}

.waveform-player .ascii-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 16px;
    background: #000;
    cursor: pointer;
}

.waveform-player .ascii-slider::-moz-range-thumb {
    width: 10px;
    height: 16px;
    background: #000;
    cursor: pointer;
    border: none;
}

.waveform-player .track-info {
    font-size: 14px;
    text-align: left;
    margin: 8px 0;
}

.waveform-player .help-text {
    font-size: 12px;
    text-align: left;
    margin-top: 5px;
    opacity: 0.6;
}

.waveform-player .playlist {
    border: 1px solid #000;
    margin: 10px 0;
    max-height: 120px;
    overflow-y: auto;
}

.waveform-player .playlist-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.waveform-player .playlist-item:last-child {
    border-bottom: none;
}

.waveform-player .playlist-item:hover {
    background: #eee;
}

.waveform-player .playlist-item.active {
    background: #000;
    color: #fff;
}

.waveform-player .playlist-header {
    font-size: 12px;
    padding: 5px 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #000;
}

/* ABOUT PAGE STYLING */
.about-container {
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
}

.about-container p {
    font-size: 16px;
    line-height: 1.8;
    color: black;
    margin: 0 0 20px 0;
    font-family: 'Courier New', monospace;
}

.about-container h3 {
    font-size: 14px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 40px 0 20px 0;
    padding: 10px 0;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    font-family: 'Courier New', monospace;
}

.about-container ul.ex1 {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.about-container ul.ex1 li {
    font-size: 14px;
    line-height: 1.6;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-family: 'Courier New', monospace;
    position: relative;
    padding-left: 20px;
}

.about-container ul.ex1 li::before {
    content: '✦';
    position: absolute;
    left: 0;
    opacity: 0.4;
}

.about-container ul.ex1 li:hover::before {
    opacity: 1;
}

.about-container ul.ex1 li:last-child {
    border-bottom: none;
}

.about-container ul.ex1 li a {
    color: #000;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.about-container ul.ex1 li a:hover {
    opacity: 0.6;
}

.about-container .itil {
    font-style: italic;
    opacity: 0.7;
}

/* Skills grid for the first list */
.about-container ul.ex1:first-of-type {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0 30px;
    border: 1px solid #000;
    padding: 15px 20px;
    margin: 20px 0 30px 0;
    position: relative;
}

.about-container ul.ex1:first-of-type::before {
    content: '/* PROFICIENT IN */';
    position: absolute;
    top: -10px;
    left: 20px;
    background: #fff;
    padding: 0 10px;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
}

.about-container ul.ex1:first-of-type li {
    border-bottom: none;
    padding: 8px 0 8px 20px;
}

/* Intro section emphasis */
.about-container > p:first-of-type {
    font-size: 18px;
    line-height: 1.9;
    padding: 30px;
    border: 1px solid #000;
    position: relative;
    margin-bottom: 0;
}

.about-container > p:first-of-type::before {
    content: '/* ABOUT */';
    position: absolute;
    top: -10px;
    left: 20px;
    background: #fff;
    padding: 0 10px;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
}


/* CONTACT PAGE STYLING  */
.contact-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.contact-container a {
    text-decoration: none;
    color: black;
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 10px);
    min-width: 300px;
}

.contact-item {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.contact-item pre {
    font-size: 17px;
    line-height: 1.2;
    color: black;
    white-space: pre;
    margin: 0;
    transform-origin: top center;
    display: inline-block;
}

.contact-item pre .char {
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.contact-item pre .char.hover-effect {
    transform: scale(2.9);
    opacity: .5;
    position: relative;
}

.contact-item pre .char.hover-effect-nearby {
    transform: scale(2.6);
    opacity: .7;
    position: relative;
}

@media (max-width: 700px) {
    .contact-container a {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: unset;
    }
}





/* NIGHT MODE CSS */
/* MODE TOGGLE */
.mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 1px solid #000;
    color: #000;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.mode-toggle:hover {
    opacity: 0.5;
}

/* DARK MODE STYLES */
body.dark-mode {
    background: #000;
    color: #fff;
}

body.dark-mode .mode-toggle {
    border-color: #fff;
    color: #fff;
}

body.dark-mode .ascii-art {
    color: #fff;
}

body.dark-mode #nav-bar li a {
    color: #ccc;
}

body.dark-mode #nav-bar li.active a {
    color: #fff;
}

body.dark-mode .waveform-player .waveform-container {
    border-color: #fff;
    background: #000;
}

body.dark-mode .waveform-player .played {
    background: #fff;
    color: #000;
}

body.dark-mode .waveform-player .playhead {
    background: #fff;
    color: #000;
}

body.dark-mode .waveform-player .status-bar {
    border-color: #fff;
}

body.dark-mode .waveform-player .ascii-btn {
    background: #000;
    border-color: #fff;
    color: #fff;
}

body.dark-mode .waveform-player .ascii-btn:hover {
    background: #fff;
    color: #000;
}

body.dark-mode .waveform-player .ascii-btn:disabled:hover {
    background: #000;
    color: #fff;
}

body.dark-mode .waveform-player .ascii-slider {
    background: #000;
    border-color: #fff;
}

body.dark-mode .waveform-player .ascii-slider::-webkit-slider-thumb {
    background: #fff;
}

body.dark-mode .waveform-player .ascii-slider::-moz-range-thumb {
    background: #fff;
}

body.dark-mode .waveform-player .playlist {
    border-color: #fff;
}

body.dark-mode .waveform-player .playlist-header {
    background: #111;
    border-color: #fff;
}

body.dark-mode .waveform-player .playlist-item {
    border-color: #333;
}

body.dark-mode .waveform-player .playlist-item:hover {
    background: #222;
}

body.dark-mode .waveform-player .playlist-item.active {
    background: #fff;
    color: #000;
}

body.dark-mode .about-container p {
    color: #fff;
}

body.dark-mode .about-container h3 {
    border-color: #fff;
}

body.dark-mode .about-container ul.ex1 li {
    border-color: #333;
}

body.dark-mode .about-container ul.ex1 li a {
    color: #fff;
}

body.dark-mode .about-container > p:first-of-type {
    border-color: #fff;
}

body.dark-mode .about-container > p:first-of-type::before {
    background: #000;
}

body.dark-mode .about-container ul.ex1:first-of-type {
    border-color: #fff;
}

body.dark-mode .about-container ul.ex1:first-of-type::before {
    background: #000;
}

body.dark-mode .carousel-btn {
    background: #000;
    color: #fff;
}

body.dark-mode .project-description p {
    color: #fff;
}

body.dark-mode .contact-container a {
    color: #fff;
}

body.dark-mode .contact-item pre {
    color: #fff;
}