/* Global styles */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Montserrat', sans-serif;
  background: none;
  color: #f5f5f5;
  overflow-x: hidden;
}

/* Star background canvas */
#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  /* Allow scroll and clicks to pass through the canvas so that the page remains scrollable. */
  pointer-events: none;
}

/* Navigation bar */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 100;
  flex-wrap: wrap;
}

nav .logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 2px;
}

nav .nav-links {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
  align-items: center;
}

nav .nav-links li {
  margin-left: 1rem;
}

nav .nav-links a {
  color: #dddddd;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  transition: color 0.3s ease, transform 0.3s ease, border-bottom 0.3s ease;
  font-weight: 500;
  position: relative;
}

nav .nav-links a:hover {
  color: #ffffff;
  transform: translateY(-2px);
  border-bottom: 2px solid #ffffff;
}

/* Language switcher */
/* Language switcher container: keep it on the right but within the nav bar */
.language-switch {
  position: relative;
  margin-left: auto;
  /* Add a small right margin so the button doesn’t sit flush against the edge */
  margin-right: 2rem;
}

#lang-btn {
  /* Language button uses an icon; keep it simple and transparent */
  /* Give the language button a subtle translucent background so the icon stands out */
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: background 0.3s ease, border-color 0.3s ease;
  width: 40px;
  height: 40px;
}

/* Hover effect for the language button */
.language-switch:hover #lang-btn {
  background: rgba(255, 255, 255, 0.1);
}

/* Style for the inline globe icon */
#lang-btn svg {
  width: 20px;
  height: 20px;
  color: #ffffff;
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  list-style: none;
  margin: 0;
  padding: 0.3rem 0;
  display: none;
  border-radius: 4px;
  min-width: 80px;
  backdrop-filter: blur(4px);
}

.lang-menu li {
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  color: #dddddd;
  transition: background 0.3s ease, color 0.3s ease;
  text-align: right;
}

.lang-menu li:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.language-switch.open .lang-menu {
  display: block;
}

/* Sections */
.section {
  min-height: 100vh;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section h2 {
  margin: 0 0 1rem;
  font-size: 2rem;
  font-weight: 600;
}

.section p {
  max-width: 800px;
  margin: 0 auto 1rem;
  line-height: 1.6;
}

/* Skills layout */
.skills-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

.skills-container .skill h3 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.skills-container .skill p {
  margin: 0 auto;
}

/* Card styling for each skill */
.skills-container .skill {
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.skills-container .skill h3 {
  color: #ffffff;
}

.skills-container .skill p {
  color: #dddddd;
}

/* Contact button */
.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
  margin-top: 1rem;
}

.btn:hover {
  background: #ffffff;
  color: #000000;
  transform: translateY(-3px);
}

@media (max-width: 768px) {
  nav {
    padding: 0.5rem;
  }
  nav .nav-links {
    display: flex;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  nav .language-switch {
    margin-left: 0;
    margin-right: 0;
    margin-top: 0.5rem;
  }
}

/* Hidden Easter egg styles */
.hidden-section {
  background: #000000;
  color: #ffffff;
  /* Increase height so the user must scroll a good distance to fill the bar */
  min-height: 300vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Progress container anchored near the bottom of the viewport.  The container holds
   the bar and the percentage label. */
.progress-container {
  width: 70%;
  max-width: 800px;
  height: 25px;
  position: fixed;
  left: 50%;
  /* Position the container near the bottom to mirror the design in the user’s
     screenshot. Using a viewport-based unit keeps it responsive. */
  /* Position the progress bar near the bottom of the viewport, similar to the reference screenshot.
     Using a smaller offset provides a more balanced look on various screen sizes. */
  bottom: 10vh;
  transform: translateX(-50%);
  /* Hidden by default; will be shown via JavaScript when the user enters the easter egg section. */
  display: none;
  align-items: center;
  gap: 0.5rem;
  z-index: 200;
}
/* The outer bar provides the border.  The fill element inside will grow from
   left to right as the user scrolls. */
.progress-bar {
  flex: 1;
  height: 100%;
  border: 2px solid #ffffff;
  border-radius: 12px;
  overflow: hidden;
}
.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(to right, #555555 0%, #ffffff 100%);
  transition: width 0.1s linear;
}
.progress-label {
  font-size: 1rem;
  color: #ffffff;
  white-space: nowrap;
}

/* Hidden message appears centred on the viewport when the bar reaches 100%. */
.hidden-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 800px;
  margin: 0;
  opacity: 0;
  z-index: 210;
  transition: opacity 0.8s ease;
}
.hidden-message.show {
  opacity: 1;
}