:root {
  --neutral-bg: #f7f9fa;
  --text: #182e40;
  --primary: #21a4f0;
  --secondary: #29c1c2;
  --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  --header-height: 70px; /* Reference for scroll padding */
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  margin: 0;
  background: var(--neutral-bg);
  color: var(--text);
  line-height: 1.6;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}

/* Header & Navigation */
header {
  background: #182e40;
  color: white;
  padding: 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1000; /* Ensures it stays above all content */
}

nav a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--secondary);
}

/* Content Sections */
section {
  max-width: 900px;
  margin: auto;
  padding: 80px 20px;
}

h2 {
  color: var(--primary);
  font-size: 2rem;
}

.profile-pic {
  width: 150px;
  height: 150px;
  object-fit: cover; /* Ensures image isn't distorted if not square */
  border-radius: 50%;
  margin-bottom: 20px;
}

/* Components */
button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background: #1883cd;
}

/* Hobby Grid */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.hobby-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
}

.hobby-card:hover {
  transform: translateY(-5px);
}

.hobby-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
}

/* Animations */
@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.fun-fact {
  display: none;
  font-size: 1.1rem;
  color: #1f9b98;
  font-style: italic;
  max-width: 500px;
  margin: 20px auto;
  padding: 15px 20px;
  border-left: 4px solid #29c1c2;
  background: #e8fffd;
  border-radius: 8px;
}

.fun-fact.show {
  display: block;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Footer & Back to Top */
footer {
  text-align: center;
  padding: 40px 20px;
  background: #182e40;
  color: white;
}

#topBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 20px;
  display: none;
  background: var(--primary);
  color: white;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  z-index: 99;
}

/* Refined Media Queries */
@media (max-width: 768px) {
  section {
    padding: 60px 20px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.4rem;
  }

  nav a {
    margin: 0 5px;
    font-size: 0.9rem;
  }

  section {
    padding: 40px 15px;
  }

  .hobby-grid {
    grid-template-columns: 1fr; /* Stack cards vertically on small phones */
  }
}
