/* Mobile-first, optimized CSS for Chinmay Singh's Portfolio */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

body {
  font-family: Verdana, Tahoma, 'Source Sans Pro', sans-serif;
  line-height: 1.5;
  color: #333;
  background: #FFF9E5;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: 0.01em;
}

/* Container for centering content */
.container {
  width: 100%;
  max-width: 100vw; /* Fix for mobile overflow */
  margin: 0 auto;
  padding: 0 8px;   /* Slightly less padding for mobile */
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* Navbar */
.navbar {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 0.7rem 0;
  overflow-x: auto; /* Fix header overflow on mobile */
}

.nav-menu {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;      /* Allow wrapping on mobile */
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;     /* Enable horizontal scroll if needed */
}

.nav-link,
.resume-btn {
  min-width: 0;         /* Prevent overflow, allow shrinking */
  word-break: break-word;
}

.nav-link,
.resume-btn {
  text-decoration: none;
  color: #1565c0;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover,
.resume-btn:hover {
  color: #fff;
  background: #1565c0;
}

.resume-btn {
  background: #1565c0;
  color: #fff;
  border: 1px solid #1565c0;
  font-weight: 600;
}

.resume-btn:hover {
  background: #104a8e;
  border-color: #104a8e;
  color: #fff;
}

.resume-icon {
  width: 1.2rem;
  height: 1.2rem;
}

/* Main content */
.main-content {
  flex: 1 0 auto;
  width: 100%;
  max-width: 100vw; /* Fix for mobile overflow */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 1rem;
  box-sizing: border-box;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem 0;
}

.profile-image {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.profile-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #eee;
  margin: 0 auto;
}

.hero-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.hero-subtitle {
  font-size: 1rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.timezone {
  font-size: 0.95rem;
  color: #888;
  margin-bottom: 1rem;
}

/* Links Section */
.links-section {
  text-align: center;
  margin-bottom: 1.5rem;
}

.link-item {
  margin: 0 0.5rem;
  color: #1565c0;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s;
}

.link-item:hover {
  color: #cc0000;
  text-decoration: underline;
}

/* About Section */
.about-content {
  max-width: 98vw;
  margin: 2rem auto 1.5rem auto;
  text-align: center;
}

.about-content h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.about-content p {
  font-size: 0.95rem;
  color: #444;
}

/* Highlights & Certifications */
.highlights-certifications-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  width: 100%;
}

.achievements-list,
.certifications-list {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 1rem 1rem;
  margin-bottom: 1rem;
}

.achievements-list h3,
.certifications-list h3 {
  font-size: 1rem;
  color: #1565c0;
  margin-bottom: 0.5rem;
}

.achievements-list ul,
.certifications-list ul {
  list-style: disc inside;
  padding-left: 0;
  margin: 0;
}

.achievements-list li,
.certifications-list li {
  margin-bottom: 0.7rem;
  color: #333;
  font-size: 0.95rem;
}

/* Skills Grid */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  width: 100%;
}

.skill-category {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 1rem 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.skill-category h4 {
  font-size: 1rem;
  color: #1565c0;
  margin-bottom: 0.5rem;
}

.skill-category p {
  font-size: 0.95rem;
  color: #333;
}

/* Substack Section */
.subscribe-section {
  margin: 2em 0;
  text-align: center;
}

.subscribe-section h3 {
  font-size: 1rem;
  color: #1565c0;
  margin-bottom: 0.5rem;
}

/* 404 Image */
.img-404 {
  width: 120px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 18px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
.footer {
  width: 100%;
  background: #fff;
  border-top: 1px solid #ddd;
  color: #666;
  text-align: center;
  padding: 1.5rem 0;
}

.footer .container {
  align-items: center;
}

.footer-links {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
}

.footer-links a {
  color: #666;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
}

.footer-links a:hover {
  color: #1565c0;
  background: rgba(21, 101, 192, 0.1);
}

/* Utility classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mt-1 { margin-top: 1rem; }

/* Responsive: Tablet and up */
@media (min-width: 600px) {
  .container,
  .main-content {
    max-width: 800px;
    padding: 0 20px;
  }
  .nav-menu,
  .footer-links {
    flex-direction: row;
    gap: 1.5rem;
  }
  .profile-photo {
    width: 120px;
    height: 120px;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .about-content h2 {
    font-size: 1.5rem;
  }
  .subscribe-section h3 {
    font-size: 1.2rem;
  }
  .img-404 {
    width: 180px;
  }
  .highlights-certifications-grid,
  .skills-grid {
    flex-direction: row;
    gap: 2rem;
  }
  .achievements-list,
  .certifications-list,
  .skill-category {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
  }
}

/* Responsive: Desktop */
@media (min-width: 1024px) {
  body {
    font-size: 18px;
  }
  .container,
  .main-content {
    max-width: 1100px;
  }
  .content-wrapper {
    max-width: 950px;
  }
}