/* CSS Variables for Theming */
:root {
    --primary-color: #2bb363;      /* Original button color */
    --secondary-color: #2c503c;
    --accent-color: #e74c3c;       /* Hover color */
    --light-color: #e74c3c;
    --dark-color: #22303e;
    --font-stack: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #1d2a36; /* color of site body background */
        --dark-color: rgba(197, 218, 210, 0.953); /* color of text in body */
        --secondary-color: #ffffff; /* code boxes and footer */
        --primary-color: #ffffff;
        --accent-color: #e28c83;
        --special-color: #e2e1ecb6; /* banner color */
    }
}

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

/* Body Styles */
body {
    font-family: var(--font-stack);
    color: var(--dark-color);
    background-color: var(--light-color);
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* Navigation Bar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--special-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
nav .logo {
    color: var(--light-color);
    font-size: 1.25rem;
    font-weight: bold;
}
nav .nav-links {
    list-style: none;
    display: flex;
}
nav .nav-links li {
    margin-left: 1.5rem;
}
nav .nav-links a {
    color: var(--light-color);
    text-decoration: none;
    font-size: 1.125rem;
    transition: color 0.3s;
}
nav .nav-links a:hover {
    color: #e74c3c ;
}

/* Hamburger Menu (Mobile) */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}
.hamburger .line {
    width: 25px;
    height: 3px;
    background: var(--light-color);
    margin: 4px 0;
}



/* Projects Section */
#projects {
    padding: 4rem 2rem; /* reduce horizontal padding */
    background-color: var(--dark-color);
    color: var(--light-color);
  }
  

#projects h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.project-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    justify-items: center;
    max-width: 960px; /* <-- constrain total grid width */
    margin: 0 auto;   /* <-- center the grid */
  }
  
  .card {
    background: var(--special-color);
    padding: 1.5rem;
    margin: 2rem;
    border-radius: 10px;
    min-width: 200px;
    max-width: 300px; /* Keeps card width consistent */
    text-align: center;
    transition: transform 0.3s, border 0.3s;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
  }

.card:hover {
    transform: translateY(-5px);
    border: 2px solid var(--accent-color); /* Accent border on hover */
}

.card h3 {
    margin-bottom: 1rem;
}

.card p {
    margin-bottom: 1.5rem;
}

/* Project Card Button */
.card .btn {
    background: var(--primary-color);
    color: var(--light-color);
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.9s ease;
}

.card .btn:hover {
    background-color: var(--accent-color);
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: var(--light-color);
    text-align: center;
    padding: 1rem 0;
}

/* Project Page Styles */
.project-page .container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.project-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.project-page h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--secondary-color);
}

.project-page .summary p,
.project-page .steps .step p,
.project-page .images .image p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.project-page .steps {
    counter-reset: step;
}

.project-page .steps .step {
    margin-bottom: 1.5rem;
}

.project-page .steps .step::before {
    counter-increment: step;
    content: "Step " counter(step) ": ";
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.project-page .images .image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.project-page .images .image {
    position: center;
}

.project-page .images .image img,
.project-page .images .image video { /* Add video styling */
    width: 100%; /* Ensures the video takes full width of the container */
    height: auto; /* Maintains aspect ratio */
    border-radius: 5px;
    transition: transform 0.3s;
}

.project-page .images .image img:hover,
.project-page .images .image video:hover { /* Ensure hover effect applies to both */
    transform: scale(1.01);
}

.project-page .images .image p {
    position: absolute;
    bottom: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.7);
    color: var(--light-color);
    width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s;
}

.project-page .images .image:hover p {
    opacity: 1;
}

/* Custom code section styling */
.code {
    background-color: #2d2d2d;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    overflow-x: auto;
}

.code pre {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}


/* Responsive Design */
@media (max-width: 868px) {
    nav .nav-links {
        flex-direction: column;
        background: var(--secondary-color);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        display: none;
    }
    nav .nav-links li {
        margin: 1rem 0;
    }
    nav .nav-links.active {
        display: flex;
    }
    .hamburger {
        display: flex;
    }
   
    .project-page .images .image-gallery {
        grid-template-columns: 1fr;
    }
    .project-cards {
        grid-template-columns: 1fr;
      }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--light-color);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}


.laser-images {
    display: flex;
    justify-content: center;
    gap: 20px; /* Space between images */
    flex-wrap: wrap; /* Ensures responsiveness */
}

.laser-images .image img {
    max-width: 300px; /* Adjust the max width as needed */
    height: auto; /* Maintain aspect ratio */
    border-radius: 5px; /* Optional: Add rounded corners */
}
 /* Inline CSS to center the canvas container */
 #p5-container {
    display: flex;
    justify-content: center;
    margin: 20px auto;
  }

