@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@100;300;400&display=swap');

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

body {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.6;
    color: #b0b0b0;
    background-color: #1a1a1a;
    overflow-x: hidden;
}

#dynamic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    filter: blur(80px);
    opacity: 0.4;
    transition: background-image 1s ease-in-out;
    transform: scale(1.1);
}

.menu-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 25px;
    height: 12px;
    cursor: pointer;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.menu-btn span {
    display: block;
    height: 1px;
    width: 100%;
    background-color: #b0b0b0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu-btn.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.overlay-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(22, 22, 22, 0.96);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.overlay-menu.open { opacity: 1; pointer-events: all; }
.overlay-menu nav { text-align: center; display: flex; flex-direction: column; gap: 30px; }
.overlay-menu nav a, .overlay-menu nav span {
    text-decoration: none;
    color: #b0b0b0;
    font-size: clamp(14px, 2vw, 16px);
    cursor: pointer;
    transition: color 0.3s;
}
.overlay-menu nav a:hover, .overlay-menu nav span:hover { color: #fff; }

.dropdown-content {
    display: none;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}
.dropdown-content a {
    font-size: clamp(12px, 1.5vw, 13px) !important;
    font-weight: 100;
    color: #888 !important;
}
.dropdown-content a:hover { color: #dedede !important; }
.has-dropdown.active .dropdown-content { display: flex; }

footer {
    position: fixed;
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 10px;
    font-weight: 100;
    color: #555;
    z-index: 1000;
    pointer-events: none;
}

.simple-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    font-weight: 100;
}
.simple-content a {
    color: #b0b0b0;
    text-decoration: none;
    border-bottom: 1px solid #444;
    transition: color 0.3s;
}
.simple-content a:hover { color: #fff; }

#loading { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: 100; font-size: 11px; z-index: 10; }

.pdf-slide {
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 40px; 
    scroll-snap-align: start;
}
#pdf-viewer {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}
#pdf-viewer::-webkit-scrollbar { display: none; }
#pdf-viewer { -ms-overflow-style: none; scrollbar-width: none; }
.pdf-slide canvas { max-width: 100%; max-height: 100%; object-fit: contain; }

.slideshow-wrapper { 
    position: relative; 
    height: 100vh; 
    width: 100vw; 
    overflow-x: auto; 
    overflow-y: hidden; 
    scroll-snap-type: x mandatory; 
    -ms-overflow-style: none; 
    scrollbar-width: none; 
    scroll-behavior: smooth;
}
.slideshow-wrapper::-webkit-scrollbar { display: none; }
.slides {
    display: flex;
    height: 100vh;
    width: max-content;
}
.slide-item {
    flex: 0 0 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 40px 100px 40px;
    text-decoration: none;
    scroll-snap-align: center;
}
.slide-item img { max-width: 90vw; max-height: 75vh; object-fit: contain; transition: transform 0.5s ease; }
.slide-item:hover img { transform: scale(1.02); }

.pagination {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100;
}
.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #555;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}
.dot.active {
    background-color: #b0b0b0;
    transform: scale(1.2);
}
.dot:hover {
    background-color: #888;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #555;
    font-size: 30px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 100;
    cursor: pointer;
    z-index: 10;
    padding: 20px;
    transition: color 0.3s;
}
.nav-arrow:hover { color: #aaa; }
.prev-arrow { left: 10px; }
.next-arrow { right: 10px; }

@media (max-width: 768px) {
    .pdf-slide, .slide-item { padding: 40px 20px; }
    .nav-arrow { padding: 10px; font-size: 24px; }
}


.download-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.4);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    z-index: 200;
    transition: background 0.3s, transform 0.3s;
    border: 1px solid rgba(255,255,255,0.1);
}
.download-btn:hover {
    background: rgba(26, 26, 26, 0.8);
    transform: translateX(-50%) scale(1.1);
}
.download-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #b0b0b0;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.download-btn:hover svg { stroke: #fff; }

/* Projects Overview */
.projects-main {
    padding: 100px 40px;
    max-width: 1400px;
    margin: 0 auto;
}
.portfolio-downloads {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 60px;
}
.dl-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #b0b0b0;
    font-size: 13px;
    padding: 10px 20px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 30px;
    transition: all 0.3s;
}
.dl-item:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}
.dl-item svg { width: 16px; height: 16px; stroke: currentColor; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.project-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #111;
    cursor: pointer;
    text-decoration: none;
}
.project-thumb canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.5s ease;
}
.project-thumb:hover canvas {
    transform: scale(1.05);
    opacity: 0.3;
}
.project-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    width: 90%;
}
.project-thumb:hover .project-title {
    opacity: 1;
}

@media (max-width: 1024px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .projects-grid { grid-template-columns: 1fr; } .portfolio-downloads { flex-direction: column; align-items: center; gap: 20px; } }

/* Back Button */
.back-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    z-index: 200;
    color: #b0b0b0;
    transition: color 0.3s, transform 0.3s;
}
.back-btn:hover {
    color: #fff;
    transform: translateX(-5px);
}
.back-btn svg { width: 24px; height: 24px; }

/* Light Theme for PDF viewers */
.light-theme {
    background-color: #ffffff;
    color: #1a1a1a;
}
.light-theme #dynamic-bg {
    display: none; /* Hide blurred colors on white pg */
}
.light-theme .menu-btn span {
    background-color: #1a1a1a;
}
.light-theme .back-btn {
    color: #1a1a1a;
}
.light-theme .back-btn:hover {
    color: #000;
}
.light-theme #loading { color: #1a1a1a; }

/* Dropdown toggling update */
.menu-item-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.menu-item-row a.main-link {
    color: #b0b0b0;
    text-decoration: none;
    font-size: clamp(14px, 2vw, 16px);
    transition: color 0.3s;
}
.menu-item-row a.main-link:hover { color: #fff; }
.dropdown-toggle {
    cursor: pointer;
    font-size: clamp(12px, 1.5vw, 14px);
    color: #b0b0b0;
    transition: transform 0.3s, color 0.3s;
}
.dropdown-toggle:hover { color: #fff; }
.dropdown-toggle.active { transform: rotate(180deg); }

/* Bottom Download Menu */
/* .bottom-download-wrapper replaced */
.old-bottom-wrapper {
    margin-top: 80px;
    text-align: center;
    padding-bottom: 40px;
}
.dl-trigger {
    cursor: pointer;
    color: #b0b0b0;
    font-size: clamp(14px, 2vw, 16px);
    transition: color 0.3s;
}
.dl-trigger:hover { color: #fff; }
.dl-menu {
    display: none;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}
.dl-menu.active { display: flex; }
.dl-menu a {
    color: #888;
    text-decoration: none;
    font-size: clamp(12px, 1.5vw, 13px);
    transition: color 0.3s;
}
.dl-menu a:hover { color: #dedede; }

/* Fix image thumbs in project loop */
.project-thumb img {
    transition: transform 0.5s ease, opacity 0.5s ease;
}
.project-thumb:hover img {
    transform: scale(1.05);
    opacity: 0.3;
}

/* Fixed download button */
.fixed-download-wrapper {
    position: fixed;
    bottom: 30px;
    right: 40px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.fixed-download-wrapper .dl-trigger {
    cursor: pointer;
    color: #b0b0b0;
    transition: color 0.3s;
    background: transparent;
    padding: 5px;
}
.fixed-download-wrapper .dl-trigger:hover { 
    color: #fff; 
}
.fixed-dl-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    position: absolute;
    bottom: 100%;
    right: 0;
}
.fixed-dl-menu.active { 
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.fixed-dl-menu a {
    color: #888;
    text-decoration: none;
    font-size: clamp(12px, 1.5vw, 13px);
    transition: color 0.3s;
    white-space: nowrap;
    background: rgba(40, 40, 40, 0.8);
    padding: 5px 10px;
    border-radius: 4px;
}
.fixed-dl-menu a:hover { 
    color: #fff;
    background: rgba(60, 60, 60, 0.9);
}

/* Ensure the downward arrow scales nicely */
.dropdown-toggle {
    font-size: clamp(16px, 2.5vw, 18px);
    display: inline-block;
}

.projects-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 20px 20px;
    gap: 15px;
    width: 100%;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.dl-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.dl-container .dl-trigger {
    cursor: pointer;
    color: #b0b0b0;
    transition: color 0.3s;
    background: transparent;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dl-container .dl-trigger:hover { 
    color: #fff; 
}

.dl-container .dl-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.dl-container .dl-menu.active { 
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dl-container .dl-menu a {
    color: #888;
    text-decoration: none;
    font-size: clamp(12px, 1.5vw, 13px);
    transition: color 0.3s;
    white-space: nowrap;
    background: rgba(40, 40, 40, 0.8);
    padding: 5px 10px;
    border-radius: 4px;
}

.dl-container .dl-menu a:hover { 
    color: #fff;
    background: rgba(60, 60, 60, 0.9);
}

.projects-footer .copyright {
    color: #b0b0b0;
    font-size: clamp(12px, 1.5vw, 14px);
    margin-top: 10px;
}
