/* ==========================================================================
   Aparajita Kashyap — Academic Portfolio Stylesheet
   ========================================================================== */

:root {
  --bg: #fafaf8;
  --bg-alt: #f2f3ef;
  --surface: #ffffff;
  --text: #181c20;
  --text-muted: #525b66;
  --border: #e1e4e8;
  --accent: #1d4e89;       /* Columbia-inspired academic slate blue */
  --accent-hover: #133661;
  --accent-soft: #e8f0fa;
  --award-bg: #fef7e0;
  --award-text: #8a5a00;
  --award-border: #f3d689;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --radius: 12px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
}

[data-theme="dark"] {
  --bg: #0f1318;
  --bg-alt: #151b22;
  --surface: #1b222c;
  --text: #eef2f6;
  --text-muted: #9aa5b4;
  --border: #2a3441;
  --accent: #6ea8fe;
  --accent-hover: #9ec5fe;
  --accent-soft: rgba(110, 168, 254, 0.14);
  --award-bg: rgba(245, 184, 65, 0.14);
  --award-text: #ffd166;
  --award-border: rgba(245, 184, 65, 0.35);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Accessibility: Skip link & Focus rings */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 300;
  background: var(--accent);
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
  text-decoration: none;
}

.nav-cv {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent) !important;
  font-weight: 600 !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

.icon-btn:hover {
  border-color: var(--accent);
}

[data-theme="light"] .moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
.mobile-only { display: none; }

/* Hero */
.hero-section {
  padding: 4.5rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 3rem;
  align-items: start;
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 4vw, 3.1rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 1.1rem;
  letter-spacing: -0.02em;
}

.lead {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  line-height: 1.45;
  color: var(--text);
  margin: 0 0 1.25rem;
}

.hero-bio p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.hero-bio p.lead {
  color: var(--text);
}

.research-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.pill {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.05rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

[data-theme="dark"] .btn-primary {
  color: #0b1320;
}

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

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-ghost {
  color: var(--text-muted);
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Hero Sidebar Card */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.avatar-placeholder {
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-alt));
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 1.75rem 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.profile-photo {
  width: 100%;
  border-radius: 10px;
  display: block;
  object-fit: cover;
}

.avatar-monogram {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

[data-theme="dark"] .avatar-monogram {
  color: #0f1318;
}

.avatar-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.quick-facts {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.fact-item {
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

.fact-item:first-child {
  border-top: none;
  padding-top: 0;
}

.fact-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.fact-value {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.alt-bg {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  margin-bottom: 2rem;
}

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

h2 {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.015em;
}

.section-sub {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Publications */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

[data-theme="dark"] .filter-btn.active {
  color: #0f1318;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pub-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pub-item:hover {
  box-shadow: var(--shadow-md);
}

.pub-item.hidden {
  display: none;
}

.pub-year {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 0.15rem;
}

.pub-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.badge-award {
  background: var(--award-bg);
  color: var(--award-text);
  border: 1px solid var(--award-border);
}

.badge-venue {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-preprint {
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-role {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.pub-title {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}

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

.pub-venue {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.84rem;
  font-weight: 600;
}

.bibtex-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.bibtex-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Talks & Posters */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.subsection-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin: 0 0 1.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-list li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.85rem;
  font-size: 0.92rem;
}

.time-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  text-align: center;
  height: fit-content;
}

.timeline-list li span {
  color: var(--text-muted);
}

.compact-list {
  padding-left: 1.15rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.91rem;
  color: var(--text-muted);
}

.compact-list strong {
  color: var(--text);
}

/* Experience & Service */
.three-col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.info-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.info-block h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.detail-list strong {
  color: var(--text);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.footer-inner p {
  margin: 0;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h3 {
  margin: 0;
}

.bib-code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 0 0 1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .two-col-grid, .three-col-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .mobile-only { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    align-items: flex-start;
  }
  .nav-links.open {
    display: flex;
  }
  .pub-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    transition: none !important;
  }
}

/* Clean print stylesheet */
@media print {
  .site-header, .filter-bar, .bibtex-btn, .contact-bar, .avatar-hint, .modal {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
    font-size: 11pt;
  }
  .section, .hero-section {
    padding: 1.25rem 0;
  }
  .pub-item, .info-block, .hero-card {
    box-shadow: none;
    border: 1px solid #cccccc;
    break-inside: avoid;
  }
}
