* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  display: flex;
  min-height: 100vh;
}

/* Sidebar navigation */
nav {
  width: 10%;
  min-width: 90px; /* prevents sidebar from becoming too tiny */
  background-color: #1a1a1a;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
}

nav a {
  color: #fff;
  text-decoration: none;
  margin: 20px 0;
  font-size: 24px;
  transition: transform 0.2s, color 0.2s;
}

nav a:hover {
  color: #1da1f2;
  transform: scale(1.2);
}

main {
  margin-left: 10%; /* matches nav width */
  padding: 20px;
  flex: 1;
  background: #f9f9f9;
  min-height: 100vh;
}

/* Hero section */
header.hero {
  text-align: center;
  background: linear-gradient(135deg, #0077b6, #023e8a);
  color: white;
  padding: 60px 20px;
  border-radius: 10px;
}

h1 {
  margin: 0;
  font-size: 2.5em;
}

/* Sections */
.section {
  margin: 40px 0;
}

.responsive-img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

/* Figure and caption */
figure img {
  width: 18rem;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

figcaption {
  text-align: center;
  font-size: 0.9em;
  color: #555;
  margin-top: 0.5em;
  font-style: italic;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  color: #777;
}

/* Mobile view */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  nav {
    flex-direction: row;
    width: 100%;
    height: auto;
    position: relative;
    justify-content: center;
  }

  main {
    margin-left: 0;
    margin-top: 10px;
  }

  figure img {
    width: 80%;
  }
}
