ul {
list-style-type: none;
  margin: 0;
  display: flex;
  justify-content: flex-end; /* Keeps links on the right */
  
  /* The "Magic" fix */
  box-sizing: border-box; 
  width: 100%;
  padding-right: 50px; /* Now this stays inside the screen */
  
  padding-top: 10px;
  padding-bottom: 10px;
  background-color: white;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  border-bottom: 1px solid #cccccc;
}


/* 1. Base style for the links */
ul li a {
  display: block;
  color: black;
  padding: 14px 16px;
  text-decoration: none;
  position: relative; /* Anchor for the underline */
}

/* 2. The Underline (The "After" element) */
ul li a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;         /* Adjust distance from text */
  width: 0;            /* Start at 0 width for the animation */
  height: 2px;
  background-color: black;
  transform: translateX(-50%);
  transition: width 0.3s ease; /* This creates the sliding growth effect */
}

/* 3. Hover State: Grow the line */
ul li a:hover::after {
  width: 60%;          /* Length on hover */
}

/* 4. Active State: Keep the line visible */
ul li a.active::after {
  width: 60%;          /* Always visible for the active page */
}

ul li a {
  display: block;
  color: black;
  padding: 14px 16px;
  text-decoration: none;
}



.flex-container {
  display: flex;
  flex-wrap: wrap;      /* This allows items to move to the next row */
  justify-content: center;
  gap: 20px;            /* This now controls BOTH row and column spacing */
  padding-left: 50px;
  padding-right: 50px;
  padding-top: 20px;
  padding-bottom:20px;
  animation: fadeInUp 1.2s ease-out forwards;
  opacity: 0; /* Starts hidden */
}

.flex-item {
  flex: 0 1 calc(33.333% - 20px); /* Keeps the 3-column grid size */
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* This keeps the zoom/blur inside the gray box */
  border-radius: 15px;
}

/* Corrected the selector from 'image' to 'img' */
img {
  display: block;
  max-width: 100%; /* Makes image responsive to the container */
  height: auto;
}

.img-button {
  position: relative; /* This stops the overlay from covering the whole screen */
  display: block;
  width: 100%;       /* Ensures it stays inside the .flex-item */
  overflow: hidden; 
}

.img-button img {
  display: block;
  width: 100%;
  transition: transform 0.5s ease, filter 0.5s ease; /* Don't forget this! */
}

/* This is the part that was likely stretching too far */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;   /* Force it to stay within the img-button boundaries */
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.img-button:hover img {
  transform: scale(1.1);
  filter: blur(4px);
}

.img-button:hover .overlay {
  opacity: 1;
}



h1{
  font-family: "Garamond", serif;
  font-weight: 400;
  
  /* Match the padding of your flex-container */
  padding-left: 50px;
  padding-right: 50px;
  
color:black;

  /* Optional: adds some space above and below the text */
  margin-top: 100px;
  margin-bottom: 20px;
  
  /* Limits the width so the text doesn't stretch too far on huge screens */
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  text-wrap: balance; /* This is a nice designer trick to prevent awkward "hanging" words */
  animation: fadeInUp 0.8s ease-out forwards;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0; /* Starts hidden */
}

body{
  margin:0;
  margin-bottom:20px;
  background-color: white;
}

h2{
  font-family: "Garamond", serif;
  font-weight: 600;
  color:black;
}

.hover-text {
  color: #ffffff;      /* Change this hex code to any color you like */
  font-family: "Garamond", serif;
  font-weight: 600;
  font-size: 2rem;   /* Makes the text a bit larger */
  z-index: 3;          /* Ensures it stays on top of the blur */
}


/* --- Tablets and Small Laptops (2 Columns) --- */
@media (max-width: 1024px) {
  .flex-item {
    /* (100% / 2) - gap adjustment */
    flex: 0 1 calc(50% - 20px); 
  }

  h1, .flex-container {
    padding-left: 30px;
    padding-right: 30px;
  }
}

/* --- Mobile Phones (1 Column) --- */
@media (max-width: 600px) {
  .flex-item {
    /* Full width on small screens */
    flex: 0 1 100%; 
  }

  h1, .flex-container {
    padding-left: 20px;
    padding-right: 20px;
  }

  

  .hover-text {
    font-size: 1.5rem; /* Scales down the hover text for smaller images */
  }
}

@media (max-width: 1024px) {
  .contact-container {
    padding-left: 30px;
    padding-right: 30px;
  }
}

@media (max-width: 600px) {
  .contact-container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

hr {
  /* 1. Controlling the length */
  width: 90%;            /* Relative to the screen size */
  max-width: 1200px;     /* Matches your H1's max-width for perfect alignment */
  
  /* 2. Controlling the look */
  border: 0;             /* Remove the default browser border */
  height: 1px;           /* Makes it a thin, professional line */
  background-color: #cccccc; /* A soft gray so it's not too distracting */
  
  /* 3. Positioning */
  margin: 40px auto;     /* Centers it and adds 40px space above/below */
  animation: fadeInUp 1s ease-out forwards;
  opacity: 0; /* Starts hidden */
}


/* --- Masonry Grid for Project Pages --- */

.masonry-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 50px;
    
    /* This creates the non-uniform vertical stacking */
    column-count: 3; 
    column-gap: 20px;
    
    /* Matches your existing page animations */
    animation: fadeInUp 1.2s ease-out forwards;
    opacity: 0;
}

.masonry-item {
    display: inline-block; /* Required for column-count to work correctly */
    width: 100%;
    margin-bottom: 20px; /* Controls the vertical spacing between images */
    border-radius: 15px;
    overflow: hidden;
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 15px;
    
    /* Adding the same grayscale hover effect from your About page */
    filter: grayscale(20%);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.masonry-item img:hover {
    filter: grayscale(0%);
    transform: scale(1.02); /* Subtle zoom for interaction */
}

/* --- Responsive adjustments for the Grid --- */

/* Tablets: Switch to 2 columns */
@media (max-width: 1024px) {
    .masonry-container {
        column-count: 2;
        padding-left: 30px;
        padding-right: 30px;
    }
}

/* Mobile: Switch to 1 column */
@media (max-width: 600px) {
    .masonry-container {
        column-count: 1;
        padding-left: 20px;
        padding-right: 20px;
    }
}

.footer-content {
  background-color: white;  /* Matches your page color */      /* Vertical breathing room */
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;             /* Centers the footer card */
  padding-top:60px;
  padding-bottom:20px;
}

.social-links a {
  margin: 0 15px;
  color: grey;
  text-decoration: none;
  font-family: "Garamond", serif;
  font-weight: 600;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: black; /* Matches your active nav link */
}

.contact-container {
/* 1. This matches your H1's centering logic */
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    
    /* 2. This matches your H1's side padding */
    padding-left: 50px;
    padding-right: 50px;
    
    /* 3. Animation & Spacing */
    margin-top: 40px;
    margin-bottom: 80px;
    opacity: 0;
    animation: fadeInUp 1.2s ease-out forwards;
}
form {
    max-width: 600px; /* The form itself is small */
    text-align: left; /* Everything stays to the left */
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    color:black;
}

/* Styling the text boxes */
input[type=text], input[type=email], textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cccccc;
    border-radius: 8px; /* Matches your image corners slightly */
    box-sizing: border-box; 
    font-family: "Garamond", serif;
    font-size: 1rem;
    background-color: #fafafa;
    transition: border 0.3s ease;
}

/* Focus effect when clicking into a box */
input:focus, textarea:focus {
    outline: none;
    border: 1px solid black;
}

/* Styling the Submit Button */
input[type=submit] {
    background-color: black;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: "Garamond", serif;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

input[type=submit]:hover {
    background-color: grey;
}

textarea {
    resize: vertical; /* Only allows the user to stretch it downwards, not sideways */
    min-height: 150px;
}

p{
  color:black;
}

/* --- About Page Specific Styles --- */

.about-container, .services-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 50px;
    animation: fadeInUp 1s ease-out forwards;
}

.about-hero {
    display: flex;
    align-items: center;
    gap: 60px;
    margin-top: 40px;
}

.about-image {
    flex: 1;
    max-width: 400px;
}

.about-image img {
    width: 100%;
    border-radius: 15px; /* Matches your flex-item corners */
    filter: grayscale(20%);
    transition: filter 0.5s ease;
}

.about-image img:hover {
    filter: grayscale(0%);
}

.about-text {
    flex: 1.5;
}

.about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.about-text p {
    font-family: "Garamond", serif;
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* --- Services Grid --- */

.services-grid {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.service-item {
    flex: 1;
    padding: 20px;
    border: 1px solid #eeeeee;
    border-radius: 10px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    border-color: black;
}

.service-item h3 {
    font-family: "Garamond", serif;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.service-item p {
    font-size: 1rem;
    color: #555555;
}

/* --- Responsive Adjustments --- */

@media (max-width: 900px) {
    .about-hero {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .services-grid {
        flex-direction: column;
    }

    .about-image {
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .about-container, .services-container {
        padding: 20px 20px;
    }
    
    .about-text h2 {
        font-size: 2rem;
    }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px); /* Starts 20px lower */
  }
  to {
    opacity: 1;
    transform: translateY(0);    /* Ends at its natural position */
  }
}