/* ==========================================================================
   Vivek Pandey — academic site
   Design: warm paper background, Newsreader serif display type, system sans
   body, a single muted accent, and hairline rules. To re-theme, change the
   tokens in :root (e.g. --accent: #1f3a68 for a Rochester navy).
   ========================================================================== */

:root {
  color-scheme: light;
  --paper: #fffefa;
  --ink: #252d2c;
  --muted: #626b68;
  --soft: #535e59;
  --accent: #315951;
  --accent-dark: #163f36;
  --line: #dce1dc;
  --rule: #99a69e;
  --select: #d9e5dd;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
img { display: block; max-width: 100%; height: auto; }
p { line-height: 1.75; margin: 0 0 1rem; }
::selection { background: var(--select); }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
a:hover { color: var(--accent-dark); text-decoration: underline; }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  text-wrap: pretty;
}
h1 { font-size: 2.65rem; letter-spacing: -0.025em; line-height: 1.08; margin: 0 0 20px; }
h2 { font-size: 1.85rem; line-height: 1.2; margin: 0; }
h3 { font-size: 1.52rem; line-height: 1.25; margin: 0 0 10px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -80px; z-index: 10;
  padding: 12px; background: var(--paper);
}
.skip-link:focus { top: 12px; }

/* ---------- Frame ---------- */

.container { max-width: 1320px; margin: 0 auto; padding: 0 54px; }

.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 26px 0 23px;
  border-bottom: 1px solid var(--line);
}
.institution-mark {
  font-size: 0.82rem; line-height: 1.6; letter-spacing: 0.015em; color: var(--muted);
}
.institution-mark .sep { margin: 0 9px; color: #87938d; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 29px; }
.site-nav a {
  font-size: 0.875rem; color: var(--muted); text-decoration: none; padding: 8px 0;
}
.site-nav a:hover { color: var(--accent); }

.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px;
  padding: 26px 0 30px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem; line-height: 1.8; color: var(--muted);
}
.site-footer p { margin: 0; font-size: inherit; line-height: inherit; }
.site-footer a { color: var(--muted); }
.footer-logo { display: inline-block; line-height: 0; }
.footer-logo img { height: 45px; width: auto; }

/* Hide the host's injected "Powered by Netlify" badge (can't be turned off on the free plan). */
#nl-badge-frame { display: none !important; }

/* ---------- Home ---------- */

.home-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 60px;
  padding: 52px 0 49px;
}
.profile { min-width: 0; }
.portrait {
  width: 210px; height: 242px;
  object-fit: cover; object-position: center 28%;
  margin-bottom: 28px;
}
.profile h1 { font-size: 2.55rem; margin-bottom: 15px; }
.role { font-size: 0.9rem; line-height: 1.65; margin: 0 0 22px; }
.role .school { display: block; color: var(--muted); }
.intro-bio { font-size: 0.95rem; line-height: 1.75; color: var(--soft); margin-bottom: 29px; }
.intro-bio p { margin: 0; line-height: inherit; }
.intro-bio p + p { margin-top: 0.85em; }
.contact {
  font-style: normal; font-size: 0.835rem; line-height: 1.9; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 19px;
}
.contact a { display: inline-block; overflow-wrap: anywhere; margin-bottom: 6px; }

.home-papers { min-width: 0; }
.section-heading { padding: 0 0 17px; border-bottom: 1px solid var(--rule); }
.section-heading h2 { font-size: 1.8rem; }
.home-papers .paper:last-of-type { border-bottom: 0; }
.home-papers { scroll-margin-top: 20px; }

/* ---------- Paper entries ---------- */

.paper {
  padding: 26px 0 25px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 25px;
  min-width: 0;
}
.paper h3 a { color: var(--ink); text-decoration: none; }
.paper h3 a:hover { color: var(--accent); text-decoration: underline; }
.coauthors { font-size: 0.89rem; line-height: 1.65; color: #56605b; margin: 0 0 9px; }
.paper-status { font-size: 0.95rem; line-height: 1.65; color: var(--muted); margin: 0; }
.paper-status em { font-style: italic; }
/* Awards and notable citations: a tinted tag so they stand out from the metadata. */
.paper-note {
  display: block; width: fit-content; max-width: 100%;
  margin: 10px 0 0; padding: 4px 11px;
  font-size: 0.9rem; font-weight: 600; line-height: 1.5;
  color: var(--accent-dark); background: var(--select);
  border-left: 3px solid var(--accent); border-radius: 2px;
}
.paper-note + .paper-note { margin-top: 6px; }

.paper-abstract { margin-top: 11px; }
.paper-abstract summary {
  width: fit-content; padding: 3px 0;
  font-size: 0.81rem; line-height: 1.7; color: var(--accent);
  cursor: pointer; list-style: none;
}
.paper-abstract summary::-webkit-details-marker { display: none; }
.paper-abstract summary::after { content: "+"; margin-left: 9px; font-size: 1rem; }
.paper-abstract[open] summary::after { content: "\2212"; }
.abstract-body { padding-top: 13px; max-width: 860px; }
.abstract-body p { font-size: 0.95rem; line-height: 1.85; color: #45534d; margin-bottom: 12px; }
.abstract-body .conferences { font-size: 0.8rem; line-height: 1.7; color: var(--muted); }
.paper-links {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin: 10px 0 0; font-size: 0.78rem; line-height: 1.65; color: var(--muted);
}
.abstract-body .paper-links { margin-top: 0; }
.paper-links a { white-space: nowrap; }
/* Abstract toggle and paper links share one row: links sit just right of "Abstract +". */
.paper-actions { position: relative; margin-top: 11px; }
.paper-actions .paper-abstract { margin-top: 0; }
/* Papers without a shown abstract: links get their own row, styled like the inline ones. */
.paper-actions > .paper-links:not(.paper-links-inline) { margin-top: 0; padding: 3px 0; font-size: 0.81rem; line-height: 1.7; }
.paper-links-inline {
  position: absolute; top: 3px; left: 7.6em;
  margin: 0; padding: 3px 0; font-size: 0.81rem; line-height: 1.7;
}
.paper-links-inline a { color: var(--accent); }

/* ---------- Research list ---------- */

.research-sidebar { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 0 0 24px; }
.section-heading + .research-sidebar { margin-top: 16px; }
.research-sidebar a { font-size: 0.875rem; line-height: 1.6; color: var(--muted); text-decoration: none; }
.research-sidebar a:hover { color: var(--accent); text-decoration: underline; }

.research-group { margin-bottom: 35px; scroll-margin-top: 28px; }
.research-group h2 {
  font-family: var(--sans); font-size: 1.2rem; font-weight: 600; line-height: 1.4;
  letter-spacing: 0.01em; color: var(--ink);
  padding-bottom: 14px; border-bottom: 1px solid var(--rule);
}
.research-group .paper:last-child { border-bottom: 0; }
.research-group h3 { font-size: 1.45rem; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .container { padding: 0 34px; }
  .home-layout { grid-template-columns: 248px minmax(0, 1fr); gap: 40px; }
  .profile h1 { font-size: 2.35rem; }
  .role { font-size: 0.875rem; }
}

@media (max-width: 660px) {
  .container { padding: 0 25px; }
  .site-header { gap: 15px; padding: 18px 0; }
  .institution-mark { max-width: 160px; font-size: 0.76rem; }
  .institution-mark .sep { display: none; }
  .institution-mark .unit { display: block; }
  .site-nav { gap: 20px; }
  .site-nav a { font-size: 0.84rem; }

  .home-layout { display: block; padding: 31px 0 27px; }
  .profile { display: grid; grid-template-columns: minmax(0, 1fr) 120px; column-gap: 22px; margin-bottom: 35px; }
  .portrait { grid-column: 2; grid-row: 1 / 3; width: 120px; height: 146px; margin: 0; }
  .profile h1 { grid-column: 1; grid-row: 1; font-size: 2.35rem; margin: 0 0 11px; }
  .role { grid-column: 1; grid-row: 2; margin: 0; font-size: 0.85rem; }
  .intro-bio { grid-column: 1 / -1; margin: 20px 0 14px; font-size: 0.94rem; line-height: 1.7; }
  .contact { grid-column: 1 / -1; padding-top: 0; border-top: 0; font-size: 0.8rem; line-height: 1.8; }
  .contact a { margin: 0; }

  .section-heading { padding-bottom: 13px; }
  .section-heading h2 { font-size: 1.7rem; }
  .paper { padding: 23px 0; }
  .paper h3 { font-size: 1.4rem; line-height: 1.28; }
  .coauthors { font-size: 0.87rem; }
  .site-footer { display: block; padding: 20px 0 24px; }
  .footer-logo { margin-bottom: 12px; }
  .footer-logo img { height: 40px; }
  .research-sidebar { gap: 10px 22px; margin-bottom: 20px; }
  .research-sidebar a { font-size: 0.82rem; }
  .research-group { margin-bottom: 29px; }
  .research-group h2 { font-size: 1.1rem; }
  .abstract-body p { font-size: 0.94rem; }
}

@media (max-width: 390px) {
  .container { padding: 0 20px; }
  .site-nav { gap: 16px; }
  .profile { grid-template-columns: minmax(0, 1fr) 100px; gap: 0 17px; }
  .portrait { width: 100px; height: 122px; }
  .profile h1 { font-size: 2.15rem; }
}

@media (pointer: coarse) {
  .site-nav a, .research-sidebar a { min-height: 44px; display: inline-flex; align-items: center; }
  .paper-abstract summary { padding: 12px 0; }
  .paper-links-inline { padding: 0; }
  .paper-links a { display: inline-flex; min-height: 44px; align-items: center; }
}

@media (prefers-reduced-motion: no-preference) {
  a { transition: color 0.15s ease; }
}

@media print {
  .site-nav, .research-sidebar, .skip-link, .paper-abstract summary { display: none !important; }
  .container { max-width: none; padding: 0; }
  body { background: #fff; color: #000; }
  .home-layout { gap: 35px; padding: 20px 0; }
  .paper { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
