/* Clean, modern styling system for Parth's single-page personal site */
:root {
  --bg-primary: #fbf8f1; /* Warm elegant cream background */
  --bg-secondary: #f5eedc; /* Warm contrast secondary color */
  --bg-card: #ffffff; /* Crisp white card background */
  --text-primary: #1c1b18; /* Soft charcoal-brown for high readability */
  --text-secondary: #5c5850;
  --text-muted: #a39e93;
  --accent-color: #1d4ed8;
  --accent-light: rgba(29, 78, 216, 0.08);
  --accent-hover: #1e40af;
  --border-color: #e8e2d3;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --container-width: 900px;
  --transition-speed: 0.3s;
}

body.dark {
  --bg-primary: #0f1012;
  --bg-secondary: #17181c;
  --bg-card: #15161a;
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #525252;
  --accent-color: #60a5fa;
  --accent-light: rgba(96, 165, 250, 0.15);
  --accent-hover: #93c5fd;
  --border-color: #26272b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header & Nav */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(251, 248, 241, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

body.dark header {
  background-color: rgba(15, 16, 18, 0.85);
}

.nav-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.2rem;
  align-items: center;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-menu a:hover {
  color: var(--text-primary);
}

.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.theme-toggle-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Mobile Menu Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.4rem;
}

.mobile-nav-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
}

/* Main Container Layout */
main {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem 1.5rem;
}

section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-color);
}

section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 35px;
  height: 2px;
  background-color: var(--accent-color);
}

/* Hero Section */
.hero-content {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.hero-text {
  flex: 1;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-bio {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  text-align: justify;
}

.hero-bio p {
  margin-bottom: 1rem;
}

.hero-bio a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}

.hero-bio a:hover {
  text-decoration: underline;
}

.hero-image-container {
  width: 200px;
  flex-shrink: 0;
  text-align: center;
}

.profile-img {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-secondary);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-speed) ease;
}

.profile-img:hover {
  transform: scale(1.03);
}

/* Social Icons Links */
.social-links {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.social-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
}

.social-icon-link:hover {
  background-color: var(--accent-color);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.social-icon-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* News Section */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.news-date {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  width: 100px;
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.news-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.news-text strong {
  color: var(--text-primary);
}

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

.news-text a:hover {
  text-decoration: underline;
}

/* Timeline/Experience Section */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -2.05rem;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--bg-primary);
  border: 2px solid var(--accent-color);
  transition: transform 0.2s ease;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
  background-color: var(--accent-color);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.timeline-role {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timeline-org-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.timeline-logo {
  height: 20px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
}

.timeline-org {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--accent-color);
}

.timeline-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  text-align: justify;
}

/* Projects Section */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color var(--transition-speed);
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.project-img-wrapper {
  width: 180px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-img {
  transform: scale(1.05);
}

.project-info {
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.project-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.project-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.project-summary {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.project-links {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.project-link, .btn-action {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-color);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.project-link:hover, .btn-action:hover {
  background-color: var(--accent-light);
}

.project-link svg, .btn-action svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

.btn-action.active svg {
  transform: rotate(180deg);
}

/* Expandable details styling */
.project-details {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
  border-top: 1px solid transparent;
  margin-top: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.project-details.show {
  max-height: 1000px; /* high value for content expansion */
  padding-top: 1.2rem;
  margin-top: 1rem;
  border-color: var(--border-color);
}

.details-content {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  text-align: justify;
}

.details-content h4 {
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.5rem;
}

.details-content p {
  margin-bottom: 0.4rem;
}

/* Publications Section */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pub-card {
  position: relative;
  padding-left: 1.8rem;
}

.pub-index {
  position: absolute;
  left: 0;
  top: 0.1rem;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pub-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.pub-authors strong {
  color: var(--text-primary);
  text-decoration: underline;
}

.pub-venue {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.pub-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.pub-link-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pub-link-btn:hover {
  background-color: var(--accent-light);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.pub-link-btn.active {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: #ffffff;
}

.pub-collapse-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin 0.2s ease;
  background-color: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid transparent;
}

.pub-collapse-container.show {
  max-height: 400px;
  margin-top: 0.6rem;
  border-color: var(--border-color);
}

.pub-abstract-text {
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: justify;
}

.pub-bibtex-text {
  padding: 1rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  background-color: var(--bg-secondary);
  overflow-x: auto;
}

/* Art Section */
.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.art-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.art-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.art-img-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--bg-secondary);
  position: relative;
}

.art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.art-card:hover .art-img {
  transform: scale(1.04);
}

.art-info {
  padding: 1rem;
}

.art-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.art-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.art-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Contact Section & Footer */
.contact-layout {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.contact-info-block {
  flex: 1;
  min-width: 280px;
}

.contact-item {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin-bottom: 1.2rem;
}

.contact-item-icon {
  color: var(--accent-color);
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.contact-item-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.contact-item-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.contact-item-text strong {
  color: var(--text-primary);
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.contact-item-text a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-item-text a:hover {
  color: var(--accent-color);
}

.cv-download-block {
  width: 280px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.cv-download-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.cv-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--accent-color);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  width: 100%;
  transition: background-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.cv-download-btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.cv-download-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-muted);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 10, 12, 0.95);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-modal.show {
  display: flex;
  opacity: 1;
}

.lightbox-content-wrapper {
  position: relative;
  max-width: 85%;
  max-height: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox-modal.show .lightbox-img {
  transform: scale(1);
}

.lightbox-caption {
  color: #f3f4f6;
  margin-top: 1rem;
  text-align: center;
  font-family: var(--font-serif);
}

.lightbox-title-text {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.lightbox-desc-text {
  font-size: 0.85rem;
  color: #9ca3af;
}

.lightbox-close-btn {
  position: absolute;
  top: -40px;
  right: -10px;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.lightbox-close-btn:hover {
  color: var(--accent-color);
}

.lightbox-close-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-content {
    flex-direction: column-reverse;
    gap: 1.5rem;
    align-items: center;
    text-align: center;
  }
  
  .hero-image-container {
    width: 100%;
  }
  
  .hero-bio {
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
  }
  
  .news-item {
    flex-direction: column;
    gap: 0.3rem;
  }
  
  .news-date {
    width: 100%;
  }
  
  .project-card {
    flex-direction: column;
  }
  
  .project-img-wrapper {
    width: 100%;
    height: 150px;
  }
  
  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .timeline-date {
    margin-top: -0.2rem;
    margin-bottom: 0.4rem;
  }
  
  /* Mobile navbar toggle */
  .mobile-nav-toggle {
    display: block;
  }
  
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    gap: 1rem;
    box-shadow: var(--shadow-md);
  }
  
  .nav-menu.show {
    display: flex;
  }
  
  .contact-layout {
    flex-direction: column;
    align-items: center;
  }
  
  .cv-download-block {
    width: 100%;
  }
}
