/* General Layout */
body {
  font-family: 'Montserrat', sans-serif;
  background-color: #f9f9f9;
  color: #111;
  margin: 0;
  padding: 0;
}

a {
  color: #0077cc;
  text-decoration: none;
}

h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

section {
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* Navigation Bar */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100vw;      /* Added to prevent overflow */
  box-sizing: border-box; /* include padding in width */
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.8rem;    /* Reduced padding slightly to fit */
  z-index: 30;
  background-color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: opacity 0.3s ease;
  opacity: 0; /* hidden initially */
  overflow-x: hidden; /* prevent horizontal scroll */
}

.nav-buttons {
  display: flex;
  gap: 1.4rem;          /* Slightly tighter gap */
  white-space: nowrap;  /* prevent wrapping */
}

.nav-button {
  font-weight: 500;
  font-size: 1rem;
  color: #111;
  padding: 7px 12px;
  border-radius: 6px;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.nav-button:hover {
  background-color: #111;
  color: #fff;
}

/* Scroll Animation: closer AA letters at start */
.container {
  height: 180vh; /* longer scroll for animation */
  position: relative;
  padding-top: 100px;
}

.centerpiece {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  display: flex;
  align-items: center;
  font-weight: 600;
  letter-spacing: 0.02em;  /* tighter spacing */
  white-space: nowrap;
  font-size: 12vw;
  user-select: none;
  color: #111;
  pointer-events: none;
}

.centerpiece .letter-left,
.centerpiece .letter-right {
  display: inline-block;
}

.centerpiece .name {
  font-weight: 300;
  font-size: 3.5vw;
  margin: 0 1vw; /* smaller gap */
  opacity: 0;
  letter-spacing: 0.03em;
}


/* About Section */
.about-section {
  margin-top: 5vh;
  text-align: center;
}

.about-section p {
  font-size: 1rem;
  max-width: 700px;
  margin: 0.5rem auto;
  line-height: 1.6;
}

/* Projects Section */
.home-projects {
  margin-top: 3rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

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

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.project-info {
  padding: 1rem;
  text-align: center;
}

.project-info h3 {
  font-weight: 400;
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.project-info p {
  font-size: 0.9rem;
  color: #444;
}


/* Contact Section */
.contact-section {
  max-width: 600px;
  margin: 3rem auto 6rem;
  padding: 0 1.5rem;
}

.contact-section h2 {
  font-weight: 600;
  font-size: 2.8rem;
  margin-bottom: 1.8rem;
  color: #111;
  text-align: center;
}

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

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 0.6rem;
  font-size: 1rem;
  color: #333;
}

.form-group input,
.form-group textarea {
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border: 1.8px solid #ccc;
  border-radius: 8px;
  transition: border-color 0.25s ease;
  font-family: 'Montserrat', sans-serif;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #111;
  outline: none;
}

.btn-submit {
  align-self: center;
  background-color: #111;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2.5rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 0.5rem;
  width: fit-content;
}

.btn-submit:hover {
  background-color: #333;
}

/* About Section */
.about-section {
  max-width: 900px;
  margin: 3rem auto 6rem;
  padding: 0 1.5rem;
  font-family: 'Montserrat', sans-serif;
  color: #222;
}

.about-container {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.about-image {
  flex: 0 0 280px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.1);
  transition: transform 0.3s ease;
}

.about-image:hover {
  transform: scale(1.03);
}

.profile-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

.about-text {
  flex: 1 1 0;
  font-size: 1.1rem;
  line-height: 1.65;
  color: #333;
}

.about-text h2 {
  font-weight: 700;
  font-size: 2.4rem;
  margin-bottom: 1rem;
  color: #111;
}

.about-text p {
  margin-bottom: 1.25rem;
}

.about-text strong {
  color: #111;
}

.about-text em {
  font-style: italic;
  color: #555;
}

.external-link {
  color: #007acc;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.25s ease;
}

.external-link:hover,
.external-link:focus {
  border-color: #007acc;
  outline: none;
}

/* Resume Section */
.resume-section {
  margin-top: 3rem;
}

.resume-section h3 {
  font-weight: 600;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #111;
}

.resume-iframe {
  width: 100%;
  height: 750px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgb(0 0 0 / 0.06);
}

.about-container {
  display: flex;
  gap: 3rem;
  align-items: center; /* Changed from flex-start to center to vertically align image and text */
  flex-wrap: wrap;
}

/* General container cards */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 2.5rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.07);
  margin-bottom: 3rem;
}

/* Page title */
.page-title {
  font-weight: 700;
  font-size: 2.8rem;
  margin-bottom: 2rem;
  color: #111;
  font-family: 'Montserrat', sans-serif;
}

/* Flash messages */
.flash-messages {
  margin-bottom: 1.5rem;
}

.flash {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
}

.flash.error {
  background: #fdecea;
  color: #b00020;
  border: 1px solid #b00020;
}

.flash.success {
  background: #e6f4ea;
  color: #2e7d32;
  border: 1px solid #2e7d32;
}

/* Example and Result Images container */
/* Smaller images */
.image-box img {
  max-width: 220px; /* smaller than before */
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* Force side-by-side layout for example and result sections with exactly two images */
.example-images,
.result-images {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: nowrap; /* prevent wrapping on bigger screens */
}

@media (max-width: 600px) {
  .example-images,
  .result-images {
    flex-wrap: wrap; /* wrap on smaller screens */
  }
  .image-box img {
    max-width: 100%; /* full width on small */
  }
  .image-box {
    flex: 1 1 100%; /* full width container on small */
  }
}


.image-box:hover {
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.1);
}

.image-label {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #444;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
}

.image-box img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* Upload Form */
.upload-form {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  font-family: 'Montserrat', sans-serif;
}

.form-label {
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
}

.form-input[type="file"] {
  padding: 0.5rem 0.25rem;
  font-size: 1rem;
  border: 1.8px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.form-input[type="file"]:focus,
.form-input[type="file"]:hover {
  border-color: #007acc;
  outline: none;
}

.btn-primary {
  background-color: #007acc;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  align-self: center;
  max-width: 200px;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #005f99;
  outline: none;
}

/* Loading message */
.loading {
  text-align: center;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  color: #007acc;
  margin-top: 1rem;
  font-size: 1.1rem;
}


/* Paint CNC images smaller */
.paint-cnc-container .image-box img {
  max-width: 220px !important; /* force smaller size */
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* Side-by-side layout specifically for Paint CNC */
.paint-cnc-container .example-images,
.paint-cnc-container .result-images {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: nowrap;
}

@media (max-width: 200px) {
  .paint-cnc-container .example-images,
  .paint-cnc-container .result-images {
    flex-wrap: wrap;
  }
  .paint-cnc-container .image-box {
    flex: 1 1 100%;
  }
  .paint-cnc-container .image-box img {
    max-width: 100% !important;
  }
}

.image-gallery.image-row {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.image-box {
  flex: 0 0 auto;
  text-align: center;
}

  .button {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background-color: #003366; /* darker blue */
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 6px 15px rgba(0, 51, 102, 0.3);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
  }
  .button:hover,
  .button:focus {
    background-color: #002244; /* even darker on hover */
    box-shadow: 0 8px 20px rgba(0, 34, 68, 0.5);
  }
  .button-container {
    text-align: center;
    margin: 1rem 0 2rem;
  }