/* ══════════════════════════════════════════════════════════
   Rajalakshmi Nandakumar — Academic Portfolio
   Style: Jurgens-inspired clean academic + modern polish
   ══════════════════════════════════════════════════════════ */

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

/* ── THEME VARIABLES ── */
:root,
[data-theme="light"] {
  --red:      #B31B1B;
  --red-dk:   #8a1414;
  --red-lt:   #f9e9e9;
  --txt:      #1a1a1a;
  --txt-2:    #444;
  --txt-3:    #666;
  --txt-4:    #888;
  --bg:       #ffffff;
  --bg-2:     #f8f7f5;
  --bg-3:     #f0ede8;
  --border:   #e0ddd8;
  --link:     #B31B1B;
  --nav-bg:   rgba(255,255,255,0.97);
  --shadow:   rgba(0,0,0,0.08);
  --pub-bg:   #ffffff;
  --toggle-bg:#f0ede8;
  --toggle-cl:#444;
}

[data-theme="dark"] {
  --red:      #e05252;
  --red-dk:   #c03030;
  --red-lt:   rgba(224,82,82,0.12);
  --txt:      #f0ede8;
  --txt-2:    #c8c4be;
  --txt-3:    #9a968f;
  --txt-4:    #6b6760;
  --bg:       #141210;
  --bg-2:     #1e1b18;
  --bg-3:     #252220;
  --border:   #2e2b27;
  --link:     #e05252;
  --nav-bg:   rgba(20,18,16,0.97);
  --shadow:   rgba(0,0,0,0.4);
  --pub-bg:   #1e1b18;
  --toggle-bg:#2e2b27;
  --toggle-cl:#f0ede8;
}

/* Smooth theme transition on all elements */
*, *::before, *::after {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* Static layout variables (not theme-dependent) */
:root {
  --font-ser: 'Source Serif 4', Georgia, serif;
  --font-san: 'Inter', system-ui, sans-serif;
  --font-mon: 'JetBrains Mono', monospace;
  --nav-h:    60px;
  --max-w:    1100px;
  --col-main: 680px;
  --col-side: 280px;
  --gap:      2.5rem;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  font-family: var(--font-san);
  font-size: 16px;
  line-height: 1.7;
  color: var(--txt);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; transition: opacity 0.2s; }
a:hover { text-decoration: underline; opacity: 0.8; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
p { margin-bottom: 0.9rem; }
p:last-child { margin-bottom: 0; }

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.nav-inner {
  display: flex; align-items: center; gap: 1rem;
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 2rem; height: 100%;
}
.nav-name {
  font-family: var(--font-ser);
  font-size: 1.05rem; font-weight: 600;
  color: var(--txt); white-space: nowrap;
  text-decoration: none; margin-right: auto;
}
.nav-name:hover { text-decoration: none; color: var(--red); }
.nav-menu {
  display: flex; gap: 0.1rem;
  list-style: none;
}
.nav-menu a {
  display: block;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem; font-weight: 500;
  color: var(--txt-3); border-radius: 6px;
  text-decoration: none; transition: background 0.18s, color 0.18s;
}
.nav-menu a:hover { background: var(--bg-2); color: var(--red); text-decoration: none; }
.nav-menu a.active { color: var(--red); }

.nav-burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-burger span {
  width: 22px; height: 2px; border-radius: 1px;
  background: var(--txt); display: block; transition: 0.25s;
}

/* ── THEME TOGGLE BUTTON ── */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--toggle-bg); border: 1px solid var(--border);
  color: var(--toggle-cl); font-size: 0.9rem;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.2s, color 0.2s, transform 0.3s, border-color 0.2s;
}
.theme-toggle:hover {
  background: var(--red-lt); color: var(--red);
  border-color: var(--red);
  transform: rotate(20deg);
}

/* ══════════════════════════════════════
   PAGE WRAP
══════════════════════════════════════ */
.page-wrap { max-width: var(--max-w); margin: 0 auto; padding: 3rem 2rem 0; }

/* ══════════════════════════════════════
   HEADER / BIO
══════════════════════════════════════ */
.bio-header {
  display: flex; gap: 2.5rem; align-items: flex-start;
  padding-bottom: 2.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 3rem;
}
.bio-photo-col {
  flex-shrink: 0; width: 210px;
}
.bio-photo-col img {
  width: 210px; height: 240px;
  object-fit: cover; object-position: center top;
  border-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.bio-links {
  display: flex; flex-direction: column; gap: 0.45rem;
  margin-top: 1rem;
}
.bio-links a {
  font-size: 0.82rem; font-weight: 500;
  color: var(--txt-3);
  display: flex; align-items: center; gap: 0.45rem;
  text-decoration: none; transition: color 0.18s;
}
.bio-links a:hover { color: var(--red); text-decoration: none; }
.bio-links i { width: 15px; text-align: center; color: var(--red); }

.bio-text-col { flex: 1; min-width: 0; }
.bio-text-col h1 {
  font-family: var(--font-ser);
  font-size: 2.4rem; font-weight: 700;
  line-height: 1.15; color: var(--txt);
  margin-bottom: 0.5rem;
}
.bio-position {
  font-size: 1rem; color: var(--txt-2); font-weight: 400;
  margin-bottom: 0.35rem;
}
.bio-location {
  font-size: 0.85rem; color: var(--txt-4);
  margin-bottom: 1.2rem; display: flex; align-items: center; gap: 0.4rem;
}
.bio-desc { font-size: 0.96rem; color: var(--txt-2); line-height: 1.75; }
.bio-desc strong { color: var(--txt); font-weight: 600; }

.bio-interests {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 1.2rem;
}
.bio-interests span {
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem; font-weight: 500;
  border-radius: 20px;
  background: var(--red-lt); color: var(--red);
  border: 1px solid rgba(179,27,27,0.2);
}

/* ══════════════════════════════════════
   CONTENT COLUMNS
══════════════════════════════════════ */
.content-cols {
  display: grid;
  grid-template-columns: 1fr var(--col-side);
  gap: var(--gap);
  align-items: start;
  padding-bottom: 4rem;
}
.main-col { min-width: 0; }
.side-col {
  position: sticky; top: calc(var(--nav-h) + 20px);
  display: flex; flex-direction: column; gap: 1.2rem;
}

/* ══════════════════════════════════════
   SECTIONS
══════════════════════════════════════ */
section { margin-bottom: 3.5rem; }
section:last-child { margin-bottom: 0; }

.sec-head {
  font-family: var(--font-ser);
  font-size: 1.5rem; font-weight: 700;
  color: var(--txt);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--red);
  margin-bottom: 1.4rem;
  display: inline-block;
}
.sec-lead {
  font-size: 0.93rem; color: var(--txt-3);
  margin-bottom: 1.5rem; line-height: 1.7;
}

/* ══════════════════════════════════════
   NEWS LIST
══════════════════════════════════════ */
.news-list { display: flex; flex-direction: column; gap: 0.9rem; }
.news-list li {
  display: flex; gap: 0.65rem; align-items: flex-start;
  font-size: 0.9rem; color: var(--txt-2); line-height: 1.65;
  padding: 0.7rem 0.9rem;
  background: var(--bg-2); border-radius: 6px;
  border-left: 3px solid transparent;
  transition: border-color 0.2s;
}
.news-list li:hover { border-left-color: var(--red); }
.news-badge {
  flex-shrink: 0; align-self: flex-start;
  padding: 0.15rem 0.55rem;
  font-size: 0.68rem; font-weight: 700;
  border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.news-badge.paper  { background: #dbeafe; color: #1d4ed8; }
.news-badge.award  { background: #fef9c3; color: #a16207; }
.news-badge.media  { background: #f3e8ff; color: #7e22ce; }
.news-badge.impact { background: #dcfce7; color: #166534; }

/* ══════════════════════════════════════
   RESEARCH AREAS
══════════════════════════════════════ */
.research-areas { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ra-card {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.2rem; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ra-card:hover { border-color: var(--red); box-shadow: 0 2px 12px rgba(179,27,27,0.08); }
.ra-icon {
  flex-shrink: 0; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--red-lt); color: var(--red); font-size: 1rem;
}
.ra-body h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.4rem; }
.ra-body p  { font-size: 0.82rem; color: var(--txt-3); line-height: 1.6; margin: 0; }

/* ══════════════════════════════════════
   PUBLICATIONS
══════════════════════════════════════ */
.pub-list { display: flex; flex-direction: column; gap: 1.4rem; }
.pub-item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.1rem; border-radius: 8px;
  background: var(--pub-bg); border: 1px solid var(--border);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.pub-item:hover { border-color: rgba(179,27,27,0.35); box-shadow: 0 2px 14px rgba(0,0,0,0.07); }

.pub-thumb {
  flex-shrink: 0; width: 90px;
}
.pub-thumb img {
  width: 90px; height: 70px;
  object-fit: cover;
  object-position: center;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.pub-title {
  font-family: var(--font-san); font-size: 0.95rem; font-weight: 600;
  line-height: 1.4; margin-bottom: 0.35rem;
}
.pub-title a { color: var(--txt); }
.pub-title a:hover { color: var(--red); }

.pub-authors { font-size: 0.82rem; color: var(--txt-3); margin-bottom: 0.25rem; }
.pub-authors strong { color: var(--txt); font-weight: 600; }
.pub-venue { font-size: 0.82rem; color: var(--txt-3); margin-bottom: 0.55rem; }
.pub-venue em { font-style: italic; }
.pub-award { color: var(--red); font-weight: 600; font-style: normal; }

.pub-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pub-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.22rem 0.7rem;
  font-size: 0.76rem; font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--txt-3);
  text-decoration: none; transition: 0.2s;
}
.pub-link:hover { border-color: var(--red); color: var(--red); text-decoration: none; background: var(--red-lt); }
.pub-link i { font-size: 0.72rem; }

/* ══════════════════════════════════════
   TEACHING
══════════════════════════════════════ */
.teach-table { width: 100%; border-collapse: collapse; }
.teach-table th {
  padding: 0.6rem 0.8rem; text-align: left;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--txt-4); border-bottom: 2px solid var(--border);
}
.teach-table td {
  padding: 1rem 0.8rem; vertical-align: top;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem; color: var(--txt-2);
}
.teach-table td strong { color: var(--txt); font-weight: 600; }
.teach-desc { font-size: 0.82rem; color: var(--txt-4); display: block; margin-top: 0.2rem; }
.teach-sem { white-space: nowrap; font-size: 0.85rem; }
.teach-sem a { display: block; margin-bottom: 0.2rem; }

/* ══════════════════════════════════════
   AWARDS
══════════════════════════════════════ */
.award-list { display: flex; flex-direction: column; gap: 0; }
.award-list li {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.award-list li:last-child { border-bottom: none; }
.aw-year {
  font-family: var(--font-mon); font-size: 0.8rem; font-weight: 500;
  color: var(--txt-4); flex-shrink: 0; width: 38px;
}
.aw-dot {
  flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
}

/* ══════════════════════════════════════
   TEAM
══════════════════════════════════════ */
.team-list {
  list-style: decimal;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.team-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--txt-2);
}
.team-list li:last-child { border-bottom: none; }
.team-list li::marker {
  color: var(--red);
  font-weight: 700;
  font-family: var(--font-mon);
  font-size: 0.82rem;
}
.team-name {
  font-weight: 600;
  color: var(--txt);
  text-decoration: none;
  transition: color 0.2s;
}
.team-name:hover {
  color: var(--red);
  text-decoration: underline;
}
.team-dash {
  color: var(--txt-4);
  margin: 0 0.4rem;
}
.team-about {
  color: var(--txt-3);
}

/* ══════════════════════════════════════
   CONTACT
══════════════════════════════════════ */
.contact-block {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 1.5rem;
}
.contact-block p {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.9rem; color: var(--txt-2); margin-bottom: 0.65rem;
}
.contact-block i { color: var(--red); width: 16px; text-align: center; }
.contact-note {
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.84rem; color: var(--txt-4);
  font-style: italic; display: block !important; align-items: unset !important; gap: unset !important;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.side-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 1.2rem;
}
.side-card h4 {
  font-family: var(--font-san); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--txt-4); margin-bottom: 0.75rem;
  padding-bottom: 0.4rem; border-bottom: 1px solid var(--border);
}
.side-card p { font-size: 0.84rem; color: var(--txt-2); line-height: 1.6; }
.side-card a { color: var(--red); }

.side-links { display: flex; flex-direction: column; gap: 0.45rem; }
.side-links li a {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.84rem; color: var(--txt-2); text-decoration: none;
  padding: 0.25rem 0; transition: color 0.18s;
}
.side-links li a:hover { color: var(--red); text-decoration: none; }
.side-links li a i { width: 15px; text-align: center; color: var(--red); font-size: 0.78rem; }

.side-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.side-tags li {
  padding: 0.2rem 0.65rem;
  font-size: 0.73rem; font-weight: 500;
  border-radius: 20px;
  background: white; color: var(--txt-3);
  border: 1px solid var(--border);
}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.site-footer {
  background: var(--bg-2); border-top: 1px solid var(--border);
  padding: 1.8rem 2rem; text-align: center;
  margin-top: 0;
}
.site-footer p {
  font-size: 0.8rem; color: var(--txt-4); margin-bottom: 0.3rem;
}
.site-footer a { color: var(--txt-4); }
.site-footer a:hover { color: var(--red); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 860px) {
  .content-cols { grid-template-columns: 1fr; }
  .side-col { position: static; flex-direction: row; flex-wrap: wrap; }
  .side-card { flex: 1; min-width: 200px; }
  .research-areas { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .bio-header { flex-direction: column; gap: 1.5rem; }
  .bio-photo-col { width: 100%; display: flex; flex-direction: column; align-items: center; }
  .bio-photo-col img { width: 180px; height: 210px; }
  .bio-links { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .bio-text-col h1 { font-size: 1.8rem; }
  .page-wrap { padding: 1.5rem 1rem 0; }
  .nav-menu { display: none; flex-direction: column; position: fixed; top: var(--nav-h); left: 0; right: 0; background: white; padding: 1rem; border-bottom: 1px solid var(--border); gap: 0; }
  .nav-menu.open { display: flex; }
  .nav-burger { display: flex; }
  .pub-thumb { display: none; }
}

/* Hide Netlify injected badge */
[data-netlify-widget],
#netlify-identity-widget,
.netlify-identity-widget,
[class*="netlify-badge"],
[id*="netlify-badge"],
iframe[src*="netlify"] {
  display: none !important;
}
