:root {
  --primary: rgb(0, 161, 0);
  --light: #98fb98;
  --dark: #009100;
  --background: #f8f9fa;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  scroll-behavior: smooth;
  background-color: var(--background);
  overflow-x: hidden;
}

a:focus,
button:focus {
  outline: 3px solid var(--light);
  outline-offset: 2px;
}

.navbar,
footer {
  background-color: rgba(15, 155, 75, 0.95) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  padding: 0.3rem 1rem;
  background-color: rgba(15, 155, 75, 0.95) !important;
}

.navbar-brand {
  color: white !important;
  font-weight: 700;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-brand:after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: white;
  transition: width 0.3s ease;
}

.navbar-brand:hover:after {
  width: 100%;
}

.nav-link {
  color: white !important;
  font-weight: 600;
  padding: 0.5rem 0.7rem !important;
  margin: 0 0.2rem;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--light) !important;
}

.nav-link:after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--light);
  transition: width 0.3s ease;
}

.nav-link:hover:after,
.nav-link.active:after {
  width: 100%;
}

.navbar-toggler {
  border: 2px solid white;
  padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.5);
}

#home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: rgb(195, 255, 193);
  padding: 6rem 1rem 3rem;
  position: relative;
  overflow: hidden;
}

#home .container {
  position: relative;
  z-index: 2;
}

.section-title {
  position: relative;
  display: inline-block;
  color: var(--dark);
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: 1.8rem;
  text-align: center;
  width: 100%;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -10px;
  width: 50px;
  height: 3px;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

section:hover .section-title::after {
  width: 80px;
}

section {
  padding: 4rem 0;
  position: relative;
}

#r112,
#r212 {
  position: relative;
  padding-top: 5rem;
}

#r112 {
  background-color: #f8f9fa;
}

#r212 {
  background: linear-gradient(to bottom right, #f8f9fa, #e9ecef);
}

.project-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  background-color: white;
  border: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  transform: translateY(0);
}

.project-card:hover,
.project-card:focus-within {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(-5px);
}

.card-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-img {
  height: 180px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-img {
  transform: scale(1.05);
}

.project-title {
  color: var(--dark);
  font-weight: 600;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.project-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.project-card:hover .project-title::after {
  width: 80px;
}

.project-description {
  color: #6c757d;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  font-size: 0.9rem;
  line-height: 1.5;
}

.btn-custom {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 8px 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  font-weight: 600;
  display: inline-block;
}

.btn-custom::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--dark);
  transition: all 0.3s ease;
  z-index: -1;
}

.btn-custom:hover {
  color: white;
}

.btn-custom:hover::before {
  left: 0;
}

.btn-custom:focus {
  box-shadow: 0 0 0 0.25rem rgba(16, 156, 17, 0.5);
  color: white;
}

#back-to-top {
  position: fixed;
  bottom: -60px;
  right: 20px;
  background-color: var(--primary);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.5s ease;
  z-index: 1000;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

#back-to-top.visible {
  bottom: 20px;
}

#back-to-top:hover {
  transform: translateY(-5px);
  background-color: var(--dark);
}

.fadeInUp {
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

footer p {
  color: white;
  padding: 0.2rem 0;
}

@media (min-width: 576px) {
  .project-img {
    height: 200px;
  }

  .section-title {
    font-size: 2rem;
  }
}

@media (min-width: 768px) {
  .navbar {
    padding: 0.7rem 2rem;
  }

  .section-title {
    text-align: left;
    font-size: 2.2rem;
  }

  .section-title::after {
    left: 0;
    transform: none;
  }

  #home {
    padding: 8rem 2rem 5rem;
  }

  .navbar-brand {
    font-size: 1.5rem;
  }

  .nav-link {
    padding: 0.5rem 1rem !important;
    margin: 0 0.5rem;
  }

  .project-img {
    height: 220px;
  }
}
