/* Bhatta-inspired academic resume layout */

:root {
  --blue-dark: #2f5e87;
  --blue-mid: #4a90e2;
  --blue-light: #6f9dc7;
  --green: #28a745;
  --purple: #7b189f;
  --text: #2b2b2b;
  --muted: #555;
  --border: #e6e8eb;
  --sidebar-width: 22%;
  --content-width: 78%;
  --max-width: 1280px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Source Serif Pro", Georgia, serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
  letter-spacing: 0.01em;
}

a {
  color: var(--blue-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.5em 1em;
  background: #fff;
  color: var(--blue-dark);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Masthead */
.masthead {
  border-bottom: 1px solid #f2f3f3;
  padding: 0.6em 0;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}

.masthead__inner-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.greedy-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-title {
  font-family: "Montserrat", sans-serif;
  font-size: 0.9em;
  font-style: italic;
  font-weight: 500;
  max-width: 70%;
  line-height: 1.35;
  background: linear-gradient(
    90deg,
    var(--blue-dark) 0%,
    var(--blue-mid) 25%,
    var(--blue-light) 50%,
    var(--blue-mid) 75%,
    var(--blue-dark) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 9s linear infinite;
}

.site-author {
  font-style: normal;
  opacity: 0.85;
}

.visible-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.visible-links a {
  font-family: "Montserrat", sans-serif;
  font-size: 0.9em;
  font-weight: 500;
  color: var(--blue-dark);
  padding: 0.35rem 0.75rem;
  text-decoration: none;
}

.visible-links a.nav-pill {
  padding: 5px 16px;
  background: rgba(74, 144, 226, 0.1);
  border: 1px solid rgba(47, 94, 135, 0.25);
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.25s, color 0.25s, transform 0.2s, box-shadow 0.25s;
}

.visible-links a.nav-pill:hover {
  background: var(--blue-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 94, 135, 0.25);
}

/* Page layout */
.initial-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

.page {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

/* Sidebar */
.sidebar {
  flex: 0 0 var(--sidebar-width);
  max-width: var(--sidebar-width);
  position: sticky;
  top: 4.5rem;
  opacity: 1;
}

.author__avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 0.5rem;
  border: 3px double #d0e0f0;
}

.author__name {
  font-family: "Montserrat", sans-serif;
  font-size: 1.45em;
  font-weight: 700;
  line-height: 1.2;
  margin: 0.75rem 0 0.4rem;
  background: linear-gradient(
    90deg,
    var(--blue-dark) 0%,
    var(--blue-mid) 25%,
    var(--blue-light) 50%,
    var(--blue-mid) 75%,
    var(--blue-dark) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 5s linear infinite;
}

.author__bio {
  font-size: 0.9em;
  line-height: 1.35;
  white-space: pre-line;
  margin: 0 0 0.5rem;
  color: #333;
}

.author__urls {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 0.85em;
  font-weight: 500;
}

.author__urls li {
  margin-bottom: 0.35rem;
}

.author__urls a {
  color: var(--text);
  text-decoration: none;
}

.author__urls a:hover {
  color: var(--blue-dark);
}

.author__urls i {
  color: var(--blue-dark);
  width: 1.25em;
}

/* Main content */
.page__content {
  flex: 1;
  min-width: 0;
}

.page__title {
  font-family: "Dancing Script", cursive;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--blue-dark);
  margin: 0 0 0.5rem;
  padding-bottom: 0.35rem;
  position: relative;
  display: inline-block;
}

.page__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, var(--blue-mid), var(--blue-light), var(--blue-mid));
}

.prose p {
  margin: 0 0 0.65em;
}

.page__content > h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.6em;
  font-weight: 700;
  margin: 1.4em 0 0.5em;
  padding-bottom: 6px;
  position: relative;
  letter-spacing: -0.01em;
  background: linear-gradient(
    90deg,
    var(--blue-dark) 0%,
    var(--blue-mid) 25%,
    var(--blue-light) 50%,
    var(--blue-mid) 75%,
    var(--blue-dark) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

.page__content > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue-light), transparent);
  transform-origin: left;
  animation: underline-grow 1.1s ease-out both;
}

/* News */
.news-scroll {
  max-height: 11.5em;
  overflow-y: auto;
  padding: 0.5em 1em 0.5em 0.5em;
  border: 1px solid #e0e0e0;
  border-left: 4px solid var(--green);
  border-radius: 6px;
  background: #fafafa;
  -webkit-mask-image: linear-gradient(to bottom, #000 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 85%, transparent 100%);
  scrollbar-width: thin;
  scrollbar-color: var(--green) transparent;
}

.news-scroll::-webkit-scrollbar {
  width: 6px;
}

.news-scroll::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 3px;
}

.news-scroll ul {
  margin: 0;
  padding-left: 1.2em;
}

.news-scroll li {
  margin-bottom: 0.35em;
}

.news-award-pill {
  display: inline;
  padding: 0 8px;
  border-radius: 6px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 0.88em;
  color: var(--purple);
  background: rgba(123, 24, 159, 0.08);
  border: 1px solid rgba(123, 24, 159, 0.18);
}

/* Timeline — evenly spaced alternating cards */
.experience-timeline {
  position: relative;
  max-width: 760px;
  margin: 1.25em auto 2em;
  padding: 0.5rem 0;
}

.experience-timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(
    to bottom,
    var(--blue-dark) 0%,
    var(--blue-light) 50%,
    var(--blue-dark) 100%
  );
  z-index: 0;
}

.tl-year {
  display: flex;
  justify-content: center;
  margin: 0.25rem 0 0.75rem;
  position: relative;
  z-index: 2;
}

.tl-year__badge {
  background: #dceaf5;
  border: 1px solid var(--blue-light);
  border-radius: 999px;
  padding: 3px 12px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--blue-dark);
  box-shadow: 0 1px 4px rgba(47, 94, 135, 0.12);
}

.tl-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: 0 14px;
  align-items: center;
  margin-bottom: 1.1rem;
  position: relative;
  z-index: 1;
}

.tl-row--left .tl-spacer {
  grid-column: 3;
}

.tl-row--left .tl-node {
  grid-column: 2;
}

.tl-row--left .tl-card {
  grid-column: 1;
  justify-self: end;
}

.tl-row--right .tl-spacer {
  grid-column: 1;
}

.tl-row--right .tl-node {
  grid-column: 2;
}

.tl-row--right .tl-card {
  grid-column: 3;
  justify-self: start;
}

.tl-node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--blue-mid);
  justify-self: center;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}

.tl-row:hover .tl-node {
  transform: scale(1.15);
  box-shadow: 0 0 0 5px rgba(74, 144, 226, 0.2);
}

.tl-row--current .tl-node {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.25);
  animation: pulse 2s infinite;
}

.tl-card {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tl-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(47, 94, 135, 0.12);
}

.tl-row--current .tl-card {
  border-color: rgba(40, 167, 69, 0.35);
  box-shadow: 0 2px 12px rgba(40, 167, 69, 0.1);
}

.tl-logo-wrap {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f8fc;
  border-radius: 8px;
  overflow: hidden;
}

.tl-logo {
  max-width: 44px;
  max-height: 44px;
  object-fit: contain;
}

.tl-body {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.tl-role {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 0.9em;
  line-height: 1.3;
  color: var(--text);
}

.tl-org {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 0.85em;
  color: var(--blue-dark);
  margin-top: 2px;
}

.tl-dates {
  font-size: 0.78em;
  color: #666;
  margin-top: 3px;
}

.logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #eef4fa;
  color: var(--blue-dark);
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 0.85em;
}

/* Projects */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-card {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.25em 1.5em;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s;
}

.project-card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.project-card h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.05em;
  margin: 0 0 0.5em;
  color: var(--blue-dark);
}

.project-card p {
  margin: 0 0 0.75em;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Experience & education detail lists */
.job-card,
.edu-card {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #ddd;
}

.job-card:last-child,
.edu-card:last-child {
  border-bottom: none;
}

.job-title,
.edu-degree {
  font-family: "Montserrat", sans-serif;
  font-size: 1.05em;
  margin: 0 0 0.25em;
  font-weight: 600;
}

.job-org,
.edu-school {
  font-family: "Montserrat", sans-serif;
  color: var(--blue-dark);
  font-weight: 500;
}

.job-meta,
.edu-meta {
  font-size: 0.9em;
  color: #666;
  margin-top: 0.15em;
}

.job-card ul {
  margin: 0.6em 0 0;
  padding-left: 1.25em;
}

.job-card li {
  margin-bottom: 0.35em;
}

/* Publications */
.publication-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 0.35em;
}

.pub-image-wrap {
  flex: 0 0 280px;
  width: 280px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  overflow: hidden;
  padding: 6px;
  box-sizing: border-box;
}

.pub-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.pub-tag {
  flex: 0 0 90px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5em;
  background: #eef4fa;
  border: 1px solid #d0e0f0;
  border-radius: 6px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.74em;
  font-weight: 600;
  color: var(--blue-dark);
  line-height: 1.3;
}

.pub-body {
  flex: 1;
  min-width: 0;
}

.pub-title-text {
  font-family: "Montserrat", sans-serif;
  font-size: 1em;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: block;
}

.pub-authors {
  font-size: 0.9em;
  line-height: 1.4;
  display: block;
  margin-top: 0.15em;
}

.pub-authors strong u {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid #333;
}

.pub-venue {
  font-size: 0.88em;
  color: var(--muted);
  display: block;
  margin-top: 0.15em;
  line-height: 1.4;
}

.pub-links {
  margin-top: 0.35em;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#publications-list hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #ddd, transparent);
  margin: 0.75em 0;
}

.btn {
  display: inline-block;
  padding: 5px 12px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.8em;
  font-weight: 600;
  border-radius: 4px;
  background: var(--blue-mid);
  color: #fff !important;
  text-decoration: none !important;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--blue-dark);
}

.muted {
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid #f2f3f3;
  padding: 1.5rem;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-size: 0.85em;
  color: #666;
}

.footer-inner p {
  margin: 0;
}

/* Animations */
@keyframes shimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes underline-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.2);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .page {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    flex: none;
    max-width: 100%;
    width: 100%;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .author__content {
    flex: 1;
  }

  .site-title {
    max-width: 100%;
    font-size: 0.82em;
  }

  .experience-timeline::before {
    left: 18px;
  }

  .tl-row {
    grid-template-columns: 28px 1fr;
    gap: 0 14px;
    margin-bottom: 1rem;
    margin-left: 0;
  }

  .tl-row--left .tl-spacer,
  .tl-row--right .tl-spacer {
    display: none;
  }

  .tl-row--left .tl-node,
  .tl-row--right .tl-node {
    grid-column: 1;
    grid-row: 1;
  }

  .tl-row--left .tl-card,
  .tl-row--right .tl-card {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    max-width: none;
  }

  .tl-year {
    justify-content: flex-start;
    padding-left: 4px;
    margin-bottom: 0.5rem;
  }

  .publication-entry {
    flex-direction: column;
  }

  .pub-image-wrap {
    flex: none;
    width: 100%;
    height: auto;
    min-height: 120px;
    max-height: 180px;
  }

  .pub-image {
    max-height: 168px;
  }

  .pub-tag {
    flex: none;
    width: 100%;
    min-height: 0;
  }
}

@media (max-width: 600px) {
  .initial-content,
  .masthead__inner-wrap {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .greedy-nav {
    flex-direction: column;
    align-items: flex-start;
  }
}
