/* ============================================================
   custom.css — nandansarkar16.github.io
   Clean, minimal academic personal site styles.
   ============================================================ */

/* ──────────────────────────────────────────────────────────
   CSS CUSTOM PROPERTIES
   ────────────────────────────────────────────────────────── */
:root {
  /* Palette — medium violet (darker than map #c898ef, lighter than NYU) */
  --bg:          #ffffff;
  --surface:     #f8f9fb;
  --text:        #1c1917;
  --text-muted:  #64748b;
  --border:      #e2e8f0;
  --accent:      #9333ea;
  --accent-dark: #7c3aed;
  --accent-bg:   #f5f0ff;
  --accent-soft: #faf5ff;
  --accent-muted: #e9d5ff;
  --accent-border: #d8b4fe;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Sizing */
  --max-w:  880px;
  --nav-h:  58px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.09);
}

/* ──────────────────────────────────────────────────────────
   RESET & BASE
   ────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover { color: var(--accent-dark); }

ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ──────────────────────────────────────────────────────────
   LAYOUT CONTAINER
   ────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ──────────────────────────────────────────────────────────
   NAVIGATION
   ────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.navbar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color 0.15s;
}

.nav-brand:hover { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.85rem;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--text-muted);
  letter-spacing: 0.005em;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover {
  color: var(--text);
  border-bottom-color: var(--border);
}

.nav-link.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ──────────────────────────────────────────────────────────
   MAIN AREA
   ────────────────────────────────────────────────────────── */
.site-main {
  padding-top: 3.75rem;
  padding-bottom: 3rem;
}

/* ──────────────────────────────────────────────────────────
   PROFILE SECTION
   ────────────────────────────────────────────────────────── */
.profile-section {
  display: flex;
  align-items: flex-start;
  gap: 3.25rem;
}

.profile-content {
  flex: 1 1 0;
  min-width: 0;
}

.profile-name {
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.profile-role {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.4rem;
  font-style: italic;
}

.profile-bio p {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.9rem;
}

.profile-bio p:last-child { margin-bottom: 0; }

.profile-bio a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Social link pills */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.6rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.28rem 0.78rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}

.social-link i {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Profile photo */
.profile-photo {
  flex-shrink: 0;
  width: 200px;
}

.profile-photo img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Placeholder shown when image fails to load */
.profile-photo.photo-placeholder {
  width: 200px;
  height: 200px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
  letter-spacing: 0.02em;
}

.profile-photo.photo-placeholder::after {
  content: "Photo\Acoming soon";
  white-space: pre;
  line-height: 1.6;
}

/* ──────────────────────────────────────────────────────────
   SECTION DIVIDER
   ────────────────────────────────────────────────────────── */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 2.5rem 0;
}

/* ──────────────────────────────────────────────────────────
   GENERIC SECTION SHELL
   ────────────────────────────────────────────────────────── */
.section-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ──────────────────────────────────────────────────────────
   NEWS TABLE
   ────────────────────────────────────────────────────────── */
.news-table {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.news-table::-webkit-scrollbar {
  width: 4px;
}

.news-table::-webkit-scrollbar-track {
  background: transparent;
}

.news-table::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.news-row {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.58rem 0;
  border-bottom: 1px solid var(--border);
}

.news-row:last-child { border-bottom: none; }

.news-date {
  flex: 0 0 88px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.news-text {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.65;
}

/* ──────────────────────────────────────────────────────────
   X / TWITTER
   ────────────────────────────────────────────────────────── */

/* Timeline iframe injected by widgets.js */
.x-timeline-wrap {
  width: 100%;
  max-width: 550px;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.x-timeline-wrap iframe {
  display: block;
  border-radius: var(--radius-lg) !important;
}

/* Before widgets.js fires, the raw anchor is visible — make it unobtrusive */
.x-timeline-wrap > a.twitter-timeline {
  display: block;
  padding: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.x-profile-card {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  max-width: 320px;
}

.x-profile-card:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.x-profile-card__handle {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.x-profile-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.x-profile-card:hover .x-profile-card__cta {
  color: var(--accent);
}

/* ──────────────────────────────────────────────────────────
   VISITOR / STATS CARDS
   ────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Visitor map full-width centered */
.visitor-map-full {
  display: flex;
  justify-content: center;
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.2s;
}

.stat-card--map {
  align-items: flex-start;
}

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

.stat-sub--map {
  margin-bottom: 0.65rem;
  max-width: 42rem;
}

.stat-card:hover { box-shadow: var(--shadow-sm); }

/* MapMyVisitors embed */
.visitor-map-embed {
  width: 100%;
  max-width: 640px;
  min-height: 180px;
  overflow: hidden;
  border-radius: var(--radius);
}

.visitor-map-embed img {
  max-width: 100% !important;
  height: auto !important;
}

.visitor-map-placeholder {
  padding: 1rem 1rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.visitor-map-placeholder__text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.visitor-map-placeholder__text code {
  font-size: 0.78rem;
  padding: 0.1rem 0.35rem;
  background: var(--surface);
  border-radius: 4px;
}

.stat-icon {
  font-size: 1.2rem;
  color: var(--accent);
  opacity: 0.7;
  margin-top: 2px;
  flex-shrink: 0;
}

.stat-label {
  font-size: 0.73rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.22rem;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.stat-sub {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 0.18rem;
}

/* ──────────────────────────────────────────────────────────
   FOOTER
   ────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  margin-top: 1rem;
}

.site-footer p {
  font-size: 0.81rem;
  color: var(--text-muted);
  text-align: center;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover { color: var(--accent); }

/* ──────────────────────────────────────────────────────────
   PAGE LAYOUT (Publications / Blog / CV)
   ────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.3rem;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.page-content {
  font-size: 0.95rem;
  line-height: 1.8;
}

.page-content h1,
.page-content h2,
.page-content h3 {
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.page-content h1 { font-size: 1.4rem; }
.page-content h2 { font-size: 1.15rem; }
.page-content h3 { font-size: 1rem; }

.page-content p { margin-bottom: 1rem; }

.page-content ul,
.page-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }

.page-content li { margin-bottom: 0.3rem; }

.page-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.page-content a:hover { color: var(--accent-dark); }

.page-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.75rem 0;
}

/* Placeholder box for coming-soon pages */
.placeholder-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3.5rem 2rem;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-muted);
}

.placeholder-box i { font-size: 1.6rem; opacity: 0.5; }
.placeholder-box p  { font-size: 0.9rem; max-width: 36ch; }
.placeholder-box a  { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Archive-style publication items (from Academic Pages includes) */
.archive__item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.archive__item:last-child { border-bottom: none; }

.archive__item-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.archive__item-title a { color: var(--text); text-decoration: none; }
.archive__item-title a:hover { color: var(--accent); }

.archive__item-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* wordwrap class used by publications.html */
.wordwrap {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ──────────────────────────────────────────────────────────
   PUBLICATION CARDS
   ────────────────────────────────────────────────────────── */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-card {
  display: flex;
  gap: 1.6rem;
  align-items: center;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.pub-card:last-child { border-bottom: none; }

/* Left thumbnail */
.pub-thumb {
  flex: 0 0 180px;
  width: 180px;
  height: 130px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s;
}

.pub-card:hover .pub-thumb {
  box-shadow: var(--shadow-sm);
}

.pub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
}

.pub-thumb:has(img) {
  padding: 0;
}

.pub-thumb__icon {
  font-size: 1.6rem;
  color: var(--border);
}

/* Right content */
.pub-body {
  flex: 1;
  min-width: 0;
}

.pub-title {
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.45;
  margin-bottom: 0.35rem;
}

.pub-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.pub-title a:hover { color: var(--accent); }

.pub-authors {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

.pub-authors strong {
  color: var(--text);
  font-weight: 600;
}

.pub-venue {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* Venue type badge */
.pub-badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pub-badge--preprint {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.pub-badge--journal {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.pub-badge--conference {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-muted);
}

/* Link buttons */
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.22rem 0.68rem;
  border-radius: 5px;
  font-size: 0.79rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.pub-btn i {
  font-size: 0.82rem;
}

.pub-btn--arxiv {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.pub-btn--arxiv:hover {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}

.pub-btn--pdf {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent-muted);
}

.pub-btn--pdf:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: var(--accent-border);
}

.pub-btn--code {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.pub-btn--code:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.pub-footnote {
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pub-scholar-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ──────────────────────────────────────────────────────────
   RESPONSIVE — TABLET
   ────────────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .profile-photo img,
  .profile-photo.photo-placeholder {
    width: 170px;
    height: 170px;
  }
  .profile-photo { width: 170px; }
}

/* ──────────────────────────────────────────────────────────
   RESPONSIVE — MOBILE
   ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 0 1.25rem; }

  .site-main { padding-top: 2.25rem; }

  /* Mobile nav drawer */
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.5rem 2rem 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  }

  .nav-links.is-open { display: flex; }

  .nav-link {
    padding: 0.55rem 0;
    border-bottom: none;
    font-size: 1rem;
    width: 100%;
  }

  .nav-link.active {
    color: var(--accent);
    border-bottom: none;
  }

  .nav-toggle { display: flex; }

  /* Profile stacks on mobile */
  .profile-section {
    flex-direction: column-reverse;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
  }

  .profile-photo,
  .profile-photo img,
  .profile-photo.photo-placeholder {
    width: 145px;
    height: 145px;
  }

  .profile-name { font-size: 1.65rem; }

  .social-links { justify-content: center; }

  .stats-grid { grid-template-columns: 1fr; }

  .page-title { font-size: 1.35rem; }

  /* Pub cards stack on mobile */
  .pub-card {
    flex-direction: column;
    gap: 1rem;
  }

  .pub-thumb {
    width: 100%;
    height: 180px;
    flex: none;
  }
}
