:root {
  --bg: #ffffff;
  --text: #333333;
  --accent: #e3e3e3;
  --link: #0077b6;
  --head-bg: #4d5656;
  --nav-bg: #2f2f2f;
  --left-border: #ffffff;
  --right-border: #ffffff;
  --pale-yellow: #feea71
}

body {
  margin: 0;
  font-family: monospace;
  font-size: 18px;
  background-color: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
  border-left: 15px solid var(--left-border);
  border-right: 15px solid var(--right-border);
}

h1 {
  font-family: sans-serif;
}

h2 {
  border: 2px solid white;
  border-radius: 10px;
  padding: 16px 16px 10px 16px;
  background-color: white; /* optional: can remove or change */
  margin: 20px 0;
  align-content: center;
  align-self: center;
  text-align: center;
  font-weight: bold;
}

@media (min-width: 768px) {
  .section-offset .intro-text h2{
  border: 2px solid white;
  }
}

header {
  background-color: var(--head-bg);
  color: white;
  text-align: center;
  padding: 20px 0px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

nav {
  background-color: var(--nav-bg);
  position: fixed;
  top: 70px; /* move it just below the header */
  left: 0;
  right: 0;
  z-index: 1001;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 10px;
  display: flex;
  justify-content: center;
  gap: 40px;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

nav ul li a:hover {
  color: #ffe026; 
  text-decoration: underline;
}

a {
  color: black;
  font-weight: bold;
}

.hamburger {
  display: none;
  font-size: 20px;
  position: fixed;
  top: 80px;
  right: 15px;
  z-index: 9999;
  cursor: pointer;
  background-color: var(--pale-yellow);
  color: black;
  border-radius: 4px;
  padding: 4px
}

#menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  nav ul {
    display: none;
    flex-direction: column;
    background-color: var(--nav-bg);
    text-align: center;
    gap: 25px;
    margin: 5px;
  }

  #menu-toggle:checked ~ main {
    margin-top: 186px; /* Shift content down by menu height */
  }
  
  #menu-toggle:checked + label + nav ul {
    display: flex;
  }
  
  .hamburger {
    display: block;
  }
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 140px 20px 10px; /* offset increased for fixed header + nav */
  transition: transform 0.3s ease;
}

@media (max-width: 768px) {
  main {
    padding-top: 80px;
  }
  }

  section {
    margin-bottom: 60px;
  }

  .unstyled-link {
    text-decoration: none;
    color: inherit;
    display: inline;
  }
  
  .unstyled-link:hover,
  .unstyled-link:focus,
  .unstyled-link:active {
    color: inherit;
    text-decoration: none;
  }

  .section-offset h2{
    scroll-margin-top: 140px; /* match fixed top spacing */
}

@media (max-width: 768px) {
  .section-offset h2{
    scroll-margin-top: 230px; /* match fixed top spacing */
  }

  .scroll-anchor-alt {
    scroll-margin-top: 140px;
  }

}

.services-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

.service-box {
  flex: 1 1 100%;
  padding: 0px 20px 20px 20px;
  border-radius: 8px;
  text-align: left;
  position: relative;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.05);
}

.service-box ul{
  margin-top: 0px;
  list-style-type: disc;
}

.service-box h3{
  text-align: center;
}

.blue-box {
  background-color: #ffffff;
  border: 2px solid red;
}

.gray-box {
  background-color: #ffffff;
  border: 2px solid red;
}

.red-box {
  background-color: #ffffff;
  border: 2px solid black;
}

.box-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
}

.flag-icon {
  width: 20px;
  height: 14px;
  margin-right: 8px;
  vertical-align: middle;
}

.experience-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.experience-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #ccc;
  padding-bottom: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap; /* allow wrapping on smaller screens */
}

.experience-content {
  max-width: calc(100% - 280px); /* reserve space for logo on wide screens */
}

.experience-text {
  font-weight: bold;
  font-size: 1.1em;
}

/* Keep nested list styling */
.experience-details {
  margin-top: 8px;
  margin-left: 20px;
  list-style-type: disc;
  color: #444;
}

.experience-logo {
  height: auto;
  margin-left: 20px;
  flex-shrink: 0;
}

.logo-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 20px;
  flex-shrink: 0;
  align-items: flex-end;
}

.logo-stack .experience-logo {
  width: 60px;
  height: auto;
}

@media (max-width: 768px) {
  .experience-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .experience-content {
    max-width: 100%;
  }

  .experience-logo {
    margin-left: 0;
    margin-top: 10px;
    align-self: flex-end;
  }

  .logo-stack  {
    align-items: center;
    align-self: flex-end;
    align-content: center;
    justify-content: center;
  }
  
  .logo-stack .experience-logo {
    align-self: center;
  }
}

@media (min-width: 425px) and (max-width: 768px) {
  .logo-stack  {
    flex-direction: row;
  }
}

.pdf-toggle {
  display: none;
}

.pdf-button {
  display: inline-block;
  padding: 3px 6px;
  background-color: var(--pale-yellow);
  color: black;
  border-radius: 20px;
  cursor: pointer;
  margin: 20px auto;
  text-align: center;
}

.pdf-container {
  display: none;
  width: 100%;
  max-width: 1200px;
  height: 500px;
  margin: 20px auto;
  border: 2px solid #ccc;
  overflow: hidden;
}

.pdf-toggle:checked + .pdf-button + .pdf-container {
  display: block;
}

.pdf-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 40px;
}

.flag-item {
  flex: 1 1 calc(33.33% - 30px); /* 3 items per row with spacing */
  max-width: calc(33.33% - 30px);
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
}

.flag-item img {
  width: 32px;
  height: auto;
}

@media (max-width: 768px) {
  .flag-item {
    flex: 1 1 calc(50% - 30px); /* 2 per row on narrow screens */
    max-width: calc(50% - 30px);
  }
}

@media (max-width: 390px) {
  .flag-item {
    flex: 1 1 calc(100% - 30px); /* 2 per row on narrow screens */
    max-width: calc(100% - 30px);
  }
}

.flag-item img {
  width: 24px;
  height: 16px;
  object-fit: cover;
}

.contact-info {
  text-align: center;
  margin-top: 20px;
}

.contact-info a {
  color: var(--link);
  font-weight: bold;
  text-decoration: none;
}

.contact-info img {
  vertical-align: middle;
  margin-right: 8px;
  width: 20px;
  height: 20px;
}

.desktop-only {
  display: none;
}

.mobile-only {
  display: block;
  text-align: center;
  margin-top: 40px;
}

.mobile-only img {
  max-width: 250px;
  border-radius: 10px;
}

.intro-text {
  font-size: 20px;
}

.intro-text p{
  text-align: left;
  font-family: monospace;
}

@media (min-width: 768px) {
  .desktop-only {
    display: block;
  }

  .mobile-only {
    display: none;
  }

  .intro-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 40px;
    padding-left: 60px;
    padding-right: 60px;
  }

  .intro-text {
    flex: 1;
    padding-right: 20px;
    font-size: 25px;
  }

  .intro-image img {
    max-width: 320px;
    height: auto;
    border-radius: 10px;
  }
}

.profile-photo {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.profile-photo img {
  max-width: 180px;
  border-radius: 50%;
  border: 4px solid var(--nav-bg);
}

footer {
  background-color: var(--nav-bg);
  color: white;
  text-align: center;
  padding: 5px 10px;
}

#backToTop {
  position: fixed;
  bottom: 20px;
  right: 30px;
  background-color: var(--pale-yellow);
  color: black;
  padding: 8px 12px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 14px;
  z-index: 1002;
}

@media (max-width: 650px) {
  footer {
    text-align: left;
    text-align: center;
  }

  footer p{
    width: calc(100% - 100px);
}
