:root {
  --bg: #f7f4ef;
  --paper: #fffdf9;
  --ink: #1e252d;
  --muted: #65707c;
  --line: #e2dbd1;
  --accent: #174a7c;
  --accent-soft: #e7eef6;
  --tag: #f1ece4;
  --shadow: 0 18px 45px rgba(38, 42, 48, 0.08);
  --radius: 18px;
  --avatar-size: 150px;
}
html[data-theme="dark"] {
  --bg: #10151d;
  --paper: #171f2a;
  --ink: #f4efe7;
  --muted: #aab3bf;
  --line: #2b3543;
  --accent: #8fbdf2;
  --accent-soft: #223349;
  --tag: #202a36;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(23, 74, 124, 0.08), transparent 32rem), var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
html[data-theme="dark"] body {
  background: radial-gradient(circle at top left, rgba(143, 189, 242, 0.12), transparent 32rem), var(--bg);
}
::selection { background: var(--accent-soft); }
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.7rem 0.9rem;
  background: var(--ink);
  color: white;
  z-index: 10;
  border-radius: 0.5rem;
}
.skip-link:focus { top: 1rem; }
.theme-toggle {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 74, 124, 0.35);
}
.floating-theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  width: auto;
  margin: 0;
}
html[data-theme="dark"] .theme-toggle { background: rgba(23, 31, 42, 0.96); }
.page {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 28px;
  padding: 42px 0 64px;
}
.sidebar {
  position: sticky;
  top: 28px;
  align-self: start;
}
.profile-card, .side-section, .section {
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .side-section,
html[data-theme="dark"] .section {
  background: rgba(23, 31, 42, 0.9);
}
.profile-card { padding: 28px; }
.profile-card img.avatar, .avatar {
  width: var(--avatar-size) !important;
  height: var(--avatar-size) !important;
  max-width: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  margin: 0 auto 24px;
  border: 4px solid var(--paper);
  box-shadow: 0 12px 32px rgba(30, 37, 45, 0.16);
  background: var(--accent);
  color: white;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-family: "Avenir Next", Avenir, "Nunito Sans", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.45rem;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
  white-space: nowrap;
  font-weight: 500;
}
h2 {
  font-size: 0.92rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent);
  margin-bottom: 20px;
}
h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}
.role {
  color: var(--ink);
  font-weight: 650;
  margin-bottom: 4px;
  white-space: pre-line;
}
.location, .summary, .meta { color: var(--muted); }
.summary, #about-text { white-space: pre-line; }
.summary { margin: 18px 0 0; }
.profile-keywords {
  margin-top: 10px;
  margin-bottom: 18px;
}
.profile-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  align-items: center;
}
.profile-icon-link {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(38, 42, 48, 0.06);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
.profile-icon-link:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 74, 124, 0.35);
  text-decoration: none;
}
html[data-theme="dark"] .profile-icon-link { background: rgba(23, 31, 42, 0.92); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.links a, .text-link, .print-button {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.links a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
html[data-theme="dark"] .links a,
html[data-theme="dark"] .top-nav a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  text-decoration: none;
  background: var(--paper);
  white-space: nowrap;
}
.links a:hover, .text-link:hover, .print-button:hover { text-decoration: underline; }
.links a:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 74, 124, 0.35);
  text-decoration: none;
}
.side-section {
  padding: 22px;
  margin-top: 16px;
}
.tags, .mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag,
.mini-tags span,
.mini-tags a {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--tag);
  color: #39424d;
  border: 1px solid var(--line);
  line-height: 1.2;
}
html[data-theme="dark"] .tag,
html[data-theme="dark"] .mini-tags span,
html[data-theme="dark"] .mini-tags a {
  color: var(--ink);
}
.tag {
  padding: 7px 10px;
  font-size: 0.85rem;
}
.mini-tags span,
.mini-tags a {
  padding: 5px 8px;
  font-size: 0.78rem;
}

.mini-tags a {
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.mini-tags a:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 74, 124, 0.35);
  text-decoration: none;
}
.side-section p { margin: 0 0 10px; }
.side-section p:last-child { margin-bottom: 0; }
.content { min-width: 0; }
.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 12px 0 18px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, var(--bg) 75%, rgba(250, 247, 242, 0));
  overflow-x: auto;
}
html[data-theme="dark"] .top-nav {
  background: linear-gradient(to bottom, var(--bg) 65%, rgba(16, 21, 29, 0));
}
.top-nav a {
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 249, 0.74);
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 0.9rem;
}
.top-nav a:hover {
  color: var(--accent);
  border-color: rgba(23, 74, 124, 0.3);
}
.section {
  padding: 28px;
  margin-bottom: 18px;
}
.section > :last-child { margin-bottom: 0; }
.compact-list {
  padding-left: 1.2rem;
  margin: 0;
}
.compact-list li + li { margin-top: 8px; }
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
}
html[data-theme="dark"] .card { background: rgba(255, 255, 255, 0.035); }
.card p { margin-bottom: 12px; }
.card .text-link {
  display: inline-block;
  margin-top: 4px;
}
.timeline {
  display: grid;
  gap: 18px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.timeline-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.year {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.9rem;
}
.timeline-body p { margin-bottom: 8px; }
.meta { font-size: 0.94rem; }
.footer {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  padding: 18px 4px 0;
}
.print-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
@media (max-width: 860px) {
  .page {
    grid-template-columns: 1fr;
    padding-top: 64px;
  }
  .sidebar, .top-nav { position: static; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page { width: min(100% - 20px, 1180px); }
  .floating-theme-toggle {
    top: 10px;
    right: 10px;
    font-size: 0.88rem;
    padding: 8px 10px;
  }
  h1 {
    white-space: normal;
    font-size: 1.55rem;
  }
  .profile-card, .side-section, .section { border-radius: 14px; }
  .profile-card, .section { padding: 22px; }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
@media print {
  :root {
    --bg: white;
    --paper: white;
    --ink: black;
    --muted: #444;
    --line: #ccc;
    --accent: black;
    --shadow: none;
  }
  body {
    background: white;
    font-size: 11pt;
  }
  .page {
    width: 100%;
    display: block;
    padding: 0;
  }
  .sidebar, .top-nav { position: static; }
  .top-nav, .print-button, .skip-link, .theme-toggle { display: none !important; }
  .profile-card, .side-section, .section {
    box-shadow: none;
    border: 0;
    padding: 0;
    margin: 0 0 18pt;
    break-inside: avoid;
  }
  .avatar, .profile-icons { display: none !important; }
  .links a, .tag, .mini-tags span, .mini-tags a {
    border: 0;
    padding: 0;
    background: transparent;
  }
  .links a::after, .text-link::after {
    content: " <" attr(href) ">";
    font-weight: 400;
  }
  .cards { grid-template-columns: 1fr; }
}


/* Polished profile icons: conventional GitHub mark and larger email icon. */
.profile-icon-link {
  width: 40px;
  height: 40px;
}

.profile-icon-symbol {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.profile-icon-link svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: currentColor;
}

.profile-icon-link.email-icon svg {
  width: 26px;
  height: 26px;
}

.profile-icon-link.github-icon svg {
  width: 23px;
  height: 23px;
}

.profile-icon-link.linkedin-icon {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 900;
}

.profile-icon-link.cv-icon {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}


/* Research interest cards */
.research-cards .card {
  overflow: hidden;
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--tag);
}


/* About-section links */
#about-text a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

#about-text a:hover {
  text-decoration: underline;
}

/* Publication authors */
.authors {
  color: var(--ink);
  font-size: 0.95rem;
  margin-bottom: 6px;
}


/* Optional intro paragraph for sections such as Supervision */
.section-intro {
  color: var(--muted);
  max-width: 72ch;
  margin-bottom: 22px;
  white-space: pre-line;
}




/* Hindi name below the main name */
.name-hindi {
  font-family: "Noto Sans Devanagari", "Kohinoor Devanagari", "Mangal", "Avenir Next", Avenir, system-ui, sans-serif;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 10px;
  letter-spacing: 0;
}


/* Linked role text */
.role {
  color: var(--ink);
  font-weight: 650;
  margin-bottom: 4px;
  white-space: normal;
  line-height: 1.35;
}
.role a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

html[data-theme="dark"] .role a {
  border-bottom-color: rgba(143, 189, 242, 0.35);
}

/* Summary now appears above the profile keywords */
.summary {
  margin-bottom: 14px;
}
/* Keep role links visually like normal role text */
.profile-card .role a,
.profile-card .role a:visited {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(23, 74, 124, 0.22);
}

.profile-card .role a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

html[data-theme="dark"] .profile-card .role a,
html[data-theme="dark"] .profile-card .role a:visited {
  color: var(--ink);
  border-bottom-color: rgba(143, 189, 242, 0.28);
}

html[data-theme="dark"] .profile-card .role a:hover {
  color: var(--accent);
}
