*, html {
  scroll-behavior: smooth;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(62deg, #3a3d40 0%, #181719 100%);
  font-family: Helvetica, Arial, sans-serif;
  color: white;
}

/*  navigation */
nav {
  position: fixed;
  height: 80px;
  width: 100%;
  animation: line 0.5s ease-in forwards;
  z-index: 99;
}

.no-list {
  list-style-type: none;
  margin: 0;
  padding: 0;
}
 

nav > ul {
  display: flex;
  height: inherit;
  align-items: center;
  justify-content: flex-end;
}

nav ul li {
  margin: 15px;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-size: 1.4em;
  opacity: 0;
  animation: show-text 0.5s ease-in 0.5s forwards;
  position: relative;
}

nav ul li a::after {
  content: '';
  display: block;
  width: 0%;
  height: 1px;
  position: absolute;
  bottom: -5px;
  left: 0;
  background-color: white;
  transition: width 0.2s ease-out;
}

nav ul li:hover a::after {
  width: 100%;
}

@keyframes line {
  0% { 
    width: 0; 
  }
  100% { 
    border-bottom: 1px solid white; 
    background: inherit;
  }
}
/*  end navigation */

#welcome-section {
  height: 100vh;
}

#text-welcome {
  position: relative;
  top: calc(100vh/3);
}

/* header section */
header {
  text-align: center;
}

h1 {
  font-size: 3.9em;
  margin: 0;
  text-shadow: 0 1px 5px black;
}


#text-welcome p
{
  font-size: 1.5em;
  font-style: italic;
  letter-spacing: 0.1rem;
  font-weight: 300;
  color: #fffafa;
}

#text-welcome h1,
#text-welcome p 
{
  opacity: 0;
  animation: show-text 0.5s ease-in 1s forwards;
}

@keyframes show-text {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
/* end header section */

/* projects section */
#projects {
  text-align: center;  
  padding: 6rem 2rem 0 2rem;
  background: #f5f5f5;
}

#projects h2 {
  font-size: 2.8em;
  margin-bottom: 4rem;
  color: #181719;
  text-shadow: 0 1px 1px black;
}
 
#projects-grid {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto;
  gap: 2em;
}

.project-tile {
  text-decoration: none;
  color: inherit;
  border: 1px solid #3a3d40;
}

.project-tile img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: contain;
  object-position: center;
  padding: 15px;
}

.project-tile p {
  margin: 0;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  background: linear-gradient(62deg, #3a3d40 0%, #181719 100%);
}

.project-tile p::before {
  content: '< ';
  margin-right: 5px;
  font-size: 0.9rem;
  visibility: hidden;
}

.project-tile p::after {
  content: ' / >';
  margin-left: 5px;
  font-size: 0.9rem;
  visibility: hidden;
}

.project-tile:hover p::before,
.project-tile:hover p::after {
  visibility: visible;
  color: #cd7f32;
}

.btn {
  display: inline-block;
  max-width: 200px;
  padding: 1rem 2rem;
  margin: 5em auto;
  text-decoration: none;
  color: white;
  background: #181719;
  font-size: 1.2rem;
  transition: background 0.3s ease-in-out;
  box-shadow: 0 0 2px black;
}

.btn i {
  transition: transform 0.3s ease-out 0.1s;
}

.btn:hover {
  background: #cd7f32;
}

.btn:hover i {
  transform: translateX(5px);
} 

/* Visit button */
.visit-btn {
  display: table;
  margin: -3em auto 5em;
}

.visit-btn i {
  margin-left: 8px;
}

.visit-btn:hover i {
  transform: translate(3px, -3px);
}

/* Space below the Visit button */
.visit-spacer {
  height: 3em;
  margin: 0;
}
/* end projects section */

/* contact section */
#contact {
  text-align: center;
  padding: 10rem;
}

#contact h2 {
  font-size: 3.5rem;
  margin: 0;
  text-shadow: 0 1px 5px black;
}

#contact p {
  font-size: 1.3rem;
  font-style: italic;
  text-shadow: 0 1px 5px black;
}

#contact-links {
  margin-top: 4em;
}

#contact-links a {
  text-decoration: none;
  color: white;
  font-size: 1.8rem;
  margin: 10px;
}

#contact-links a i {
  transition: transform 0.2s ease-out; 
}

#contact-links a i:hover {
  transform: scale(1.2);
}
/* end contact section */

/* footer */
footer {
  display: flex;
  justify-content: space-around;
  padding: 10px 20px;
  border-top: 4px solid white;
  column-gap: 10px;
  letter-spacing: .05rem;
  font-weight: 300;
}

footer p:nth-of-type(1) {
  width: 50%;
}

/* end footer */

@media ( max-width: 820px ) {
  
  #contact {
    padding: 10rem 2rem;
  }
  
}

/* Dropdown menu */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  flex-direction: column;
  align-items: stretch;
  top: 100%;
  left: 0;
  min-width: 180px;
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
  background: #181719;
  border: 1px solid #3a3d40;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu li a {
  display: block;
  padding: 12px 16px;
  font-size: 1rem;
  white-space: nowrap;
  opacity: 1;
  animation: none;
}

.dropdown-menu li a:hover {
  background: #3a3d40;
  color: white;
}

/* Show submenu on hover or keyboard focus */
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: block;
}

.arrow {
  font-size: 0.8em;
}

/* Logo */
.logo {
  width: 350px;
  height: auto;
}

.logo-thumbnail {
  width: 180px;
  height: 180px;
  object-fit: contain;
}

/* Show all button displaying the images */
/* Lightbox background */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
}

/* Show the lightbox */
.lightbox.active {
  display: flex;
}

/* Enlarged image */
#lightbox-image {
  display: block;
  max-width: 80%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Close button */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  background: none;
  border: none;
  color: white;
  font-size: 40px;
  cursor: pointer;
}

/* Previous and next arrows */
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 40px;
  cursor: pointer;
  padding: 15px;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* Image counter */
#lightbox-counter {
  position: absolute;
  bottom: 15px;
  color: white;
  font-size: 16px;
}

.lightbox-arrow:hover,
.lightbox-close:hover {
  color: #cd7f32;
}

/* Smaller screens */
@media (max-width: 600px) {
  #lightbox-image {
    max-width: 85%;
    max-height: 70vh;
  }

  .lightbox-arrow {
    font-size: 28px;
    padding: 8px;
  }

  .lightbox-prev {
    left: 0;
  }

  .lightbox-next {
    right: 0;
  }
}


/* Responsive navigation */
@media (max-width: 820px) {
  nav {
    height: auto;
    min-height: 60px;
    background: #181719;
  }

  nav > ul {
    flex-wrap: nowrap;
    justify-content: center;
    padding: 8px 4px;
  }

  nav ul li {
    margin: 6px;
  }

  nav ul li a {
    font-size: 0.85rem;
  }

  .dropdown-menu {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Responsive welcome section */
#text-welcome {
  padding: 0 20px;
}

#text-welcome h1 {
  font-size: clamp(2rem, 5vw, 3.9em);
  overflow-wrap: anywhere;
}

#text-welcome p {
  font-size: clamp(1rem, 2.5vw, 1.5em);
}

@media (max-width: 600px) {
  #welcome-section {
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 0 40px;
  }

  #text-welcome {
    top: 0;
  }

  #text-welcome h1 {
    font-size: 2rem;
  }

  #text-welcome p {
    font-size: 1rem;
    letter-spacing: 0.03rem;
  }

  .logo {
    width: min(280px, 80vw);
  }

  .logo-thumbnail {
    width: 120px;
    height: 120px;
  }
}

/* Responsive sections */
@media (max-width: 600px) {
  #projects {
    padding: 4rem 1rem 0;
  }

  #projects h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }

  #projects-grid {
    gap: 1rem;
  }

  .project-tile p {
    padding: 1rem;
  }

  .btn {
    margin: 3rem auto;
  }

  #contact {
    padding: 5rem 1rem;
  }

  #contact h2 {
    font-size: 2.3rem;
  }

  footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
  }

  footer p:nth-of-type(1) {
    width: 100%;
  }
}

/* Responsive project grid for tablets and mobile devices */
/* Tablet layout: 2 columns */
@media (max-width: 900px) {
  #projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile layout: 1 column */
@media (max-width: 600px) {
  #projects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}