/* --- Base Styling --- */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f3f6f9;
  margin: 0;
  color: #222;
  padding-bottom: 70px; /* Prevent overlap with fixed footer */
}

/* --- Header Section --- */
header {
  background: #1a237e;
  color: #fff;
  padding: 2rem 0 0 0;
  margin-bottom: 0;

  /* ✨ Fade-down animation */
  opacity: 0;
  transform: translateY(-20px);
  animation: headerFadeDown 0.53s ease-out forwards;
  animation-delay: 0.15s;
}

@keyframes headerFadeDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

header .container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.subtitle {
  font-size: 1.2rem;
  color: #c5cae9;
  margin-top: 0.5rem;
  padding-bottom: 1rem;
}

/* --- Navigation Bar --- */
.nav-bar {
  background: #3949ab;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 2rem;

  /* Animation for smooth stagger */
  opacity: 0;
  transform: translateY(-15px);
  animation: headerFadeDown 0.53s ease-out forwards;
  animation-delay: 0.25s;
}

.nav-bar ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 800px;
  display: flex;
  justify-content: center;
}

.nav-bar li {
  display: inline;
}

.nav-bar a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  transition: background-color 0.2s, color 0.2s;
  font-weight: 500;
}

.nav-bar a:hover {
  background-color: #5c6bc0;
  text-decoration: none;
  color: #e8eaf6;
}

/* --- Main Container --- */
main .container {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.07);
  padding: 2rem;
}

.about-section h2 {
  color: #1a237e;
  margin-bottom: 1rem;
}

ul {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
  list-style-type: disc;
}

/* --- Layout and Sidebar --- */
.main-grid {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.main-content {
  flex: 3;
}

.sidebar {
  flex: 1;
  padding: 15px;
  background: #eef1f5;
  border-radius: 6px;
  font-size: 0.95rem;
  position: sticky;
  top: 20px;
}

.sidebar h3 {
  color: #1a237e;
  font-size: 1.2rem;
  margin-top: 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #3949ab;
  margin-bottom: 15px;
}

.sidebar ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.sidebar li {
  margin-bottom: 8px;
  line-height: 1.4;
}

/* --- Professional Experience --- */
.experience-list {
  margin: 0.08rem 0;
  padding-left: 1.1rem;
  list-style-type: disc;
  line-height: 1.6;
}

.experience-list li {
  margin-bottom: 0.4rem;
  line-height: inherit;
}

.job-history {
  list-style: none;
  padding-left: 0;
}

.job-history > li {
  margin-bottom: 2.5rem;
}

.company {
  color: #374151;
  font-weight: bold;
  font-size: 1.07em;
  letter-spacing: 0.01em;
  margin: 0 0 1px 0;
}

.highlight-iitm {
  color: #1a237e;
  font-weight: bold;
  letter-spacing: 0.02em;
}

section {
  margin-bottom: 2.1rem;
  clear: both;
}

/* --- Links --- */
a {
  color: #3949ab;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.hidden-link {
  color: inherit;
  text-decoration: none;
  cursor: default;
}
.hidden-link:hover {
  text-decoration: underline;
  cursor: pointer;
  color: #3949ab;
}

/* --- CTA Button --- */
.cta-button {
  display: inline-block;
  background-color: #3949ab;
  color: white;
  padding: 0.75rem 1.5rem;
  margin-top: 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 6px rgba(57, 73, 171, 0.2);
}
.cta-button:hover {
  background-color: #1a237e;
  transform: translateY(-1px);
  box-shadow: 0 5px 7px rgba(57, 73, 171, 0.3);
}

/* --- Inline formula --- */
.formula {
  font-size: 0.9em;
  font-style: italic;
  margin: 0 5px;
  white-space: nowrap;
}

/* --- Images --- */
img {
  max-width: 100%;
  height: auto;
}
.image-right-float {
  float: right;
  width: 27%;
  margin-left: 20px;
  margin-bottom: 15px;
}
.image-right-float_2 {
  float: right;
  width: 40%;
  margin-left: 20px;
  margin-bottom: 15px;
}

/* --- Responsive Layout --- */
@media (max-width: 600px) {
  main .container {
    padding: 1rem;
  }
  .nav-bar ul {
    flex-direction: column;
  }
  .main-grid, .article-grid-layout {
    flex-direction: column;
    gap: 0;
  }
}

/* --- Article Page Layout --- */
.article-grid-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}
.article-article-content {
  flex: 3;
}
.article-page-sidebar {
  flex: 1;
  padding: 15px;
  background: #eef1f5;
  border-radius: 6px;
  font-size: 0.95rem;
  position: sticky;
  top: 20px;
}
.article-page-sidebar h3 {
  color: #1a237e;
  font-size: 1.2rem;
  margin-top: 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #3949ab;
  margin-bottom: 15px;
}
.article-page-sidebar ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}
.article-page-sidebar li {
  margin-bottom: 8px;
  line-height: 1.4;
}

/* --- Translucent Fixed Footer with LinkedIn Icon + Animation --- */
footer {
  background: rgba(26, 35, 126, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
  border-top: 1px solid rgba(255,255,255,0.15);

  opacity: 0;
  transform: translateY(15px);
  animation: footerFadeUp 0.53s ease-out forwards;
  animation-delay: 0.2s;
}

@keyframes footerFadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.5rem;
  gap: 0.4rem;
}

.footer-content p {
  margin: 0;
  color: #e8eaf6;
  line-height: 1.2;
}

.linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: #e8eaf6;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.25s ease;
  font-size: 0.85rem;
}

.linkedin-link:hover {
  color: #b3e5fc;
  transform: translateY(-2px) scale(1.03);
}

.linkedin-icon {
  width: 18px;
  height: 18px;
  filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(180deg) brightness(100%);
  transition: filter 0.2s ease;
}

.linkedin-link:hover .linkedin-icon {
  filter: invert(72%) sepia(57%) saturate(748%) hue-rotate(180deg) brightness(97%) contrast(95%);
}

@media (max-width: 600px) {
  .footer-content {
    font-size: 0.8rem;
    gap: 0.3rem;
  }
  .linkedin-icon {
    width: 16px;
    height: 16px;
  }
}

/* ✅ Move mobile override here — ensures it wins */
@media (max-width: 600px) {
  .sidebar, .article-page-sidebar {
    order: -1;
    position: static;
    margin-bottom: 2rem;
    flex: none;
    width: 100%;
  }
}
