/* Global Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-bg: #f5f6fa;
    --transition: all 0.3s ease;
    --modal-max-width: 960px;
    --modal-padding-desktop: 2rem;
    --modal-padding-mobile: 1rem;
    --modal-radius: 16px;
    --modal-gap: 1.25rem;
    --modal-title-size: 1.6rem;
    --modal-close-size: 2rem;
    --section-max-width: 900px;
    --section-padding: 2rem 1rem;
    --section-gap: 2.5rem;
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body {
  background-color: #101010;
  color: #f5f5f5;
  font-family: 'Roboto', sans-serif;
}

.navbar {
    background-color: #101010;
    color: #fff;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    font-family: 'Source Code Pro', monospace;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Source Code Pro', monospace;
}

.logo {
    font-size: 1.5rem;
    color: #fff;
    font-family: 'Source Code Pro', monospace;
    cursor: pointer;
    transition: var(--transition);
}

.logo:hover {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    font-family: 'Source Code Pro', monospace;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.section {
    padding: var(--section-padding);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--section-gap);
}

.summary-section + .section {
    margin-top: var(--section-gap);
}

.container {
    max-width: var(--section-max-width);
    margin: 0 auto;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition);
}

.reveal-on-scroll.active {
    opacity: 1;
    transform: translateY(0);
}


.cta-button:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    font-family: 'Roboto', monospace;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-image {
    height: 200px;
    background: var(--light-bg);
}

.project-card h3 {
    padding: 1rem;
    color: var(--primary-color);
}

.project-card p {
    padding: 0 1rem 1rem;
    color: var(--text-color);
}

.experience-timeline {
    max-width: var(--section-max-width);
    margin: 2rem auto 0 auto;
    position: relative;
    padding: 0 1rem;
}

.experience-entry {
    display: block;
    margin-bottom: 2rem;
}

.experience-timeline > .experience-entry:last-of-type {
    margin-bottom: 0;
}

.experience-content {
    background: #181818;
    color: #f5f5f5;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.18);
    width: 100%;
}

.experience-content h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.company-name {
    color: #e0e0e0;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.date {
    color: #b0b0b0;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.description {
    margin-bottom: 0;
    line-height: 1.6;
}

/* Education Section */
.education-timeline {
    max-width: var(--section-max-width);
    margin: 2rem auto 0 auto;
    position: relative;
    padding: 0 1rem;
}

.education-entry {
    display: block;
    margin-bottom: 2rem;
}

.education-timeline > .education-entry:last-of-type {
    margin-bottom: 0;
}

.education-content {
    background: #181818;
    color: #f5f5f5;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.18);
    width: 100%;
}

.education-content h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.university-name {
    color: #e0e0e0;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.gpa {
    color: #b0b0b0;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.education-content ul {
    margin: 1rem 0 0 1.1rem;
}

.education-content li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.contact-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.contact-item a:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: #4a90e2;
    transform: translateY(-2px);
}

.contact-icon {
    font-size: 1.2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 768px) {
    .contact-info {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .contact-item a {
        width: 100%;
        justify-content: center;
    }
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background: var(--primary-color);
}
/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--primary-color);
    color: white;
}

.burger {
    display: none;
    cursor: pointer;
    flex-direction: column;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 3px 0;
    transition: var(--transition);
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        background: #101010;
        width: 100%;
        height: calc(100vh - 70px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 2rem;
        transition: right 0.3s ease;
        border-top: 1px solid #333;
    }

    .nav-links li {
        margin: 1rem 0;
        opacity: 0;
        transform: translateX(50px);
        transition: all 0.3s ease;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
    }

    .burger {
        display: flex;
    }

    .burger.active .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .burger.active .line2 {
        opacity: 0;
    }

    .burger.active .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    #home h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1.2rem;
    }
}

.summary-section {
    background: #101010;
    color: #fff;
    padding: var(--section-padding);
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.summary-container {
    width: 100%;
    max-width: var(--section-max-width);
    margin: 0 auto;
    text-align: left;
    border-radius: 16px;
    border: 2px solid #101010;
    padding: 2rem 1.5rem;
}

.summary-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.summary-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

.summary-socials .social-icon {
    font-size: 1.3rem;
    color: #fff;
}

.summary-location {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: #b0b0b0;
}

.summary-about {
    margin-top: 0.7rem;
    font-size: 1rem;
    line-height: 1.4;
    color: #e0e0e0;
}

.tech-carousel {
    overflow: hidden;
    width: 100%;
    margin: 2rem 0 1rem 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tech-track {
    display: flex;
    width: max-content;
    align-items: center;
    gap: 0.5rem;
    will-change: transform;
}

.tech-track.top {
    animation: scroll-tech-left 40s linear infinite;
}
.tech-track.middle {
    animation: scroll-tech-right 45s linear infinite;
}
.tech-track.bottom {
    animation: scroll-tech-left 50s linear infinite;
}

.tech-carousel:hover .tech-track {
    animation-play-state: paused;
    transition: transform 0.3s ease-out;
}

@keyframes scroll-tech-left {
    0% { 
        transform: translateX(0);
    }
    100% { 
        transform: translateX(-50%);
    }
}

@keyframes scroll-tech-right {
    0% { 
        transform: translateX(-50%);
    }
    100% { 
        transform: translateX(0);
    }
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    margin: 0 0.5rem;
    opacity: 0.85;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    will-change: transform, opacity;
}

.tech-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-bottom: 0.3rem;
    /* Prevent image flickering */
    backface-visibility: hidden;
}

.tech-item span {
    color: #fff;
    font-size: 0.8rem;
    margin-top: 0.1rem;
    letter-spacing: 0.5px;
}

.tech-item img[alt="Latex"],
.tech-item img[alt="LaTeX"],
.tech-item img[alt="Rust"] {
    width: 40px;
    height: 40px;
}

.tech-item:hover {
    transform: scale(1.1);
    opacity: 1;
}

.tech-carousel * {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.project-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(20, 20, 20, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(.4,2,.6,1);
    overflow: hidden;
}

html {
  overflow-y: scroll;
  background-color: #101010;
}

body {
  overflow-y: visible;
}
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
body {
  scrollbar-width: none;
}

html.no-scroll {
  overflow: hidden;
}

.project-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
    display: flex;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.project-modal-content {
    background: #181818;
    color: #f5f5f5;
    border-radius: var(--modal-radius);
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
    max-width: var(--modal-max-width);
    width: 100%;
    max-height: none;
    height: auto;
    padding: var(--modal-padding-desktop);
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.project-modal-overlay.active .project-modal-content {
    transform: scale(1);
    opacity: 1;
}
.project-modal-content h2,
#modal-title,
#tool-modal-title {
    margin: 0 0 var(--modal-gap) 0;
    font-size: var(--modal-title-size);
    line-height: 1.25;
}

#modal-description,
#tool-modal-body {
    margin-top: var(--modal-gap);
    font-size: 1rem;
    line-height: 1.55;
    color: #eaeaea;
}
#tool-modal-body ul {
    margin: 0.5rem 0 0 1.1rem;
}
#tool-modal-body li {
    margin: 0.25rem 0;
}

#modal-image {
    width: 100%;
    aspect-ratio: 16 / 9; /* Changed from 9/16 to 16/9 for landscape video content */
    max-width: 800px; /* Increased from 375px to accommodate landscape videos */
    margin: 0 auto;
    background: #222;
    margin-bottom: var(--modal-gap);
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#modal-image video,
#modal-image iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    display: block;
    background: #222;
}

/* Special handling for mobile/portrait content */
#modal-image.portrait {
    aspect-ratio: 9 / 16;
    max-width: 375px;
}

@media (max-width: 900px) {
    .project-modal-content {
        max-width: 100%;
        height: auto;           
        padding: var(--modal-padding-mobile);
    }
    #modal-image {
        max-width: 90%; /* Use percentage for better mobile responsiveness */
        height: auto;
        min-height: 200px; /* Increased min-height for landscape videos */
    }
    #modal-image.portrait {
        max-width: 320px;
        min-height: 180px;
    }
}

@media (max-width: 600px) {
  .project-modal-content {
    padding: 0.2rem 0 0.7rem 0;
  }
  #modal-image {
    width: 90%;
    max-width: 90%;
    margin: 0 auto;
    border-radius: 10px;
    border: 1px solid #444;
    background: #222;
    margin-bottom: 1rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #modal-image.portrait {
    aspect-ratio: 9 / 16;
    max-width: 300px;
  }
  #modal-image img,
  #modal-image video,
  #modal-image iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    background: #222;
    display: block;
  }
  .project-modal-description {
    margin-top: 0.5rem;
    padding: 0 0.5rem;
    text-align: left;
  }
}
.project-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: var(--modal-close-size);
    color: #fff;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.project-modal-close:hover {
    color: var(--secondary-color);
}

h1, h2, h3, h4, h5, h6,
.section-title,
.summary-name,
.project-card h3,
.experience-content h3 {
    font-family: 'Source Code Pro', monospace;
}

/* Add consistent spacing for section titles */
.section h2 {
    margin-bottom: 2rem;
}

.section-title {
    margin-bottom: 2rem;
}

.summary-container, .container {
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .summary-container, .container, .experience-timeline {
    max-width: 100%;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .section {
    padding: 1.5rem 0.5rem;
    margin-top: 2rem;
  }
  
  .summary-section {
    padding: 1.5rem 0.5rem;
  }
  
  /* Force desktop view for all project cards except NoXcuses on mobile */
  .projects-grid {
      /* Override mobile behavior - force desktop grid layout */
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
      gap: 1.5rem !important;
      margin-top: 2rem;
      justify-items: center !important;
  }
  
  .project-card:not(.mobile-friendly) {
      /* Force desktop sizing for all projects except NoXcuses */
      min-width: 300px !important;
      max-width: 350px !important;
      width: 350px !important;
      margin: 0 auto !important;
      flex-shrink: 0 !important;
  }
  
  .project-card.mobile-friendly {
      /* Allow NoXcuses to be fully responsive on mobile */
      width: 100% !important;
      max-width: 100% !important;
      min-width: unset !important;
      margin: 0 !important;
  }
  
  /* Ensure project images maintain proper aspect ratio */
  .project-card:not(.mobile-friendly) .project-image {
      height: 200px !important;
  }
  
  .project-card.mobile-friendly .project-image {
      height: 250px !important; /* Slightly taller for mobile viewing */
  }
}

.tech-carousel .tech-item img {
    filter: brightness(0) invert(1);
}

/* Remove filter for colored PNG images */
.tech-carousel .tech-item img[alt="SQL"],
.tech-carousel .tech-item img[alt="NumPy"] {
    filter: none;
}