/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  font-family: Arial, sans-serif;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  height: 100%;
  overflow-x: hidden;
}

/* Scrollbar container */
body::-webkit-scrollbar {
  width: 12px;
}

/* Scrollbar track (background) */
body::-webkit-scrollbar-track {
  background: #222629;
}

/* Scrollbar thumb (the draggable part) */
body::-webkit-scrollbar-thumb {
  background-color: #474B4F;
  border-radius: 10px;
  border: 3px solid #61892F;
}

body::-webkit-scrollbar-thumb:hover {
  background-color: #6B6E70;
}

/* Header and Navigation */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(71, 75, 79, 0);
  backdrop-filter: blur(10px);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo {
  font-size: 2rem;
  font-weight: bolder;
  margin-left: 1rem;
}

nav ul {
  list-style: none;
  padding: 0;
  text-align: center;
}

nav ul li {
  display: inline;
  margin: 0 1rem;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
}

section,
.project {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  scroll-snap-align: start;
  padding: 2rem;
  box-sizing: border-box;
}

#home {
  background-image: linear-gradient(rgba(34, 38, 41, 1), rgba(0, 0, 0, 0.1)),
    url('images/HexBackground.jpg');
  background-size: cover;
  background-position: top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  height: 100vh;
  color: white;
}

#home .Headshot {
  width: 25vh;
  height: 25vh;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #86C232;
  /* Slightly thicker border for emphasis */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  /* Deeper shadow for pop */
  filter: brightness(1.1) contrast(1.15) saturate(1.05);
  /* Vivid color boost */
  transition: transform 0.4s ease, filter 0.3s ease;
}

#home .Headshot:hover {
  transform: scale(1.05);
}

#home .text-box {
  background-color: #474B4F;
  color: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#projects {
  background-color: #222629;
}

.text-box {
  background-color: #474B4F;
  color: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Memory Allocator Section */

.memory-allocator {
  background-color: #222629;
}

.memory-allocator .text-box {
  background-color: #474B4F;
  color: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.image-row1 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.Gmacs {
  width: 40vh;
  height: 40vh;
  object-fit: cover;
  border-radius: 10%;
  border: 2px solid #86C232;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.50);
  filter: brightness(1.05) contrast(1.1);
  transition: transform 0.3s ease;
  flex: 0 0 auto;
}

.Gmacs:hover {
  transform: scale(1.05);
}

.Diagram {
  width: 40vh;
  height: 40vh;
  object-fit: cover;
  border-radius: 10%;
  border: 2px solid #86C232;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.50);
  filter: brightness(1.05) contrast(1.1);
  transition: transform 0.3s ease;
  flex: 0 0 auto;
}

.Diagram:hover {
  transform: scale(1.05);
}

.Editor {
  width: 40vh;
  height: 40vh;
  object-fit: cover;
  border-radius: 10%;
  border: 2px solid #86C232;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.50);
  filter: brightness(1.05) contrast(1.1);
  transition: transform 0.3s ease;
  flex: 0 0 auto;
}

.Editor:hover {
  transform: scale(1.05);
}

/* Simple Computer Section */

.four-bit-computer {
  background-color: #222629;
}

.four-bit-computer .text-box {
  background-color: #474B4F;
  color: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.image-row2 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.Circuit {
  width: 40vh;
  height: 40vh;
  object-fit: cover;
  border-radius: 10%;
  border: 2px solid #86C232;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.50);
  filter: brightness(1.05) contrast(1.1);
  transition: transform 0.3s ease;
  flex: 0 0 auto;
}

.Circuit:hover {
  transform: scale(1.05);
}

.Verilog {
  width: 40vh;
  height: 40vh;
  object-fit: cover;
  border-radius: 10%;
  border: 2px solid #86C232;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.50);
  filter: brightness(1.05) contrast(1.1);
  transition: transform 0.3s ease;
  flex: 0 0 auto;
}

.Verilog:hover {
  transform: scale(1.05);
}

.Testbench {
  width: 40vh;
  height: 40vh;
  object-fit: cover;
  border-radius: 10%;
  border: 2px solid #86C232;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.50);
  filter: brightness(1.05) contrast(1.1);
  transition: transform 0.3s ease;
  flex: 0 0 auto;
}

.Testbench:hover {
  transform: scale(1.05);
}

.VEditor {
  width: 40vh;
  height: 40vh;
  object-fit: cover;
  border-radius: 10%;
  border: 2px solid #86C232;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.50);
  filter: brightness(1.05) contrast(1.1);
  transition: transform 0.3s ease;
  flex: 0 0 auto;
}

.VEditor:hover {
  transform: scale(1.05);
}

/* Amplifier Design Section */

/* Amplifier section background */
.amplifier-design {
  background-color: #222629;
}

/* Text box styling */
.amplifier-design .text-box {
  background-color: #474B4F;
  color: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  text-align: center;
  margin: 0 auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Row containing content (if needed) */
.amplifier-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 2rem;
}

/* Buttons centered in a row */
.button-row {
  margin: 1rem 0;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Dropdown buttons */
.dropdown-toggle {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.4rem;
  border: 2px solid;
  background-color: #61892F;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.dropdown-toggle.active {
  background-color: #86C232;
  color: white;
  border: 2px solid #fff;
  font-weight: bold;
}

.dropdown-toggle:hover {
  background-color: #61892F;
  transform: translateY(-2px);
}

/* Image gallery container (one per button) */
.dropdown-content {
  display: none;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0;
  max-width: 100%;
  text-align: center;
}

.dropdown-content img {
  width: 40vh;
  height: 40vh;
  object-fit: cover;
  border-radius: 10%;
  border: 2px solid #86C232;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.50);
  filter: brightness(1.05) contrast(1.1);
  transition: transform 0.3s ease;
  flex: 0 0 auto;
}

.dropdown-content img:hover {
  transform: scale(1.05);
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.more-projects {
  background-color: #222629;
}

.more-projects .text-box {
  background-color: #474B4F;
  color: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.github-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.4rem;
  border: 2px solid;
  background-color: #61892F;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.github-button:hover {
  background-color: #86C232;
  transform: translateY(-2px);
}

/* About Me Section */

#about {
  background-color: #222629;
}

#about .text-box {
  background-color: #474B4F;
  color: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.image-row3 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.Climb {
  width: 40vh;
  height: 40vh;
  object-fit: cover;
  border-radius: 10%;
  border: 2px solid #86C232;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.50);
  filter: brightness(1.05) contrast(1.1);
  transition: transform 0.3s ease;
  flex: 0 0 auto;
}

.Climb:hover {
  transform: scale(1.05);
}

.Moose {
  width: 40vh;
  height: 40vh;
  object-fit: cover;
  border-radius: 10%;
  border: 2px solid #86C232;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.50);
  filter: brightness(1.05) contrast(1.1);
  transition: transform 0.3s ease;
  flex: 0 0 auto;
}

.Moose:hover {
  transform: scale(1.05);
}

.Muss {
  width: 40vh;
  height: 40vh;
  object-fit: cover;
  border-radius: 10%;
  border: 2px solid #86C232;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.50);
  filter: brightness(1.05) contrast(1.1);
  transition: transform 0.3s ease;
  flex: 0 0 auto;
}

.Muss:hover {
  transform: scale(1.05);
}

/* Contact Me Section */

#contact {
  background-image: linear-gradient(rgba(34, 38, 41, 1), rgba(0, 0, 0, 0.1)),
    url('images/HexBackground.jpg');
  background-size: cover;
  background-position: top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  height: 100vh;
  color: white;
}

#contact .text-box {
  background-color: #474B4F;
  color: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.action-button {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  margin: 0.5rem;
  background-color: #61892F;
  color: white;
  font-weight: bold;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.action-button:hover {
  background-color: #86C232;
  transform: translateY(-2px);
}

/* Expandable images styling */

/* The Modal (background) */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 5vh;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

/* Modal Image */
.modal-content {
  display: block;
  margin: auto;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Close button */
.close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
}

/* Design for Mobile Devices*/

/* Hamburger button (hidden on desktop) */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
}

/* 3 bars */
.nav-toggle .bar {
  display: block;
  width: 26px;
  height: 2px;
  background: #fff;
  margin: 6px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate to X when open */
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile layout */
@media (max-width: 768px) {
  header {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

  #home,
  #contact {
    background-attachment: scroll;   /* Prevents flickering on iOS */
    background-position: center;
    background-size: cover;
    min-height: auto;
    height: auto;
    padding: 2rem 1rem;
  }

  .nav-toggle {
    display: block;
    margin-left: auto; /* push button to the right */
  }

  /* Make the nav take full width under the header row */
  #primary-nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    background-color: rgba(34, 38, 41, 0.95); /* matches your theme */
    backdrop-filter: blur(10px);
    border-top: 1px solid #474B4F;
    transition: max-height 0.3s ease;
  }
  #primary-nav.open {
    max-height: 300px; /* enough to show all links; adjust if needed */
  }

  nav ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0.75rem;
    text-align: left;
  }

  nav ul li {
    display: block;       
    margin: 0;            
  }

  nav ul li a {
    display: block;
    padding: 0.75rem 0.25rem;
    color: #fff;
    text-decoration: none;
  }

  /* Improve touch targets and focus */
  .nav-toggle:focus-visible,
  nav ul li a:focus-visible {
    outline: 2px solid #86C232;
    outline-offset: 2px;
  }

  section,
  .project {
    min-height: unset;
    height: auto;
    padding: 1.5rem 1rem;
    scroll-snap-align: none; 
  }
  .text-box {
    padding: 1rem;
    font-size: 0.95rem;
  }
}