/* =========================================================
   Chethan Krishnamurthy Ramanaik: site styles
   Layout: fixed left sidebar (photo, contact, navigation)
           + wide content column on the right
   ========================================================= */

:root {
  --bg: #ffffff;
  --text: #2b2f3a;
  --muted: #5d6475;
  --accent: #2f5bd3;
  --accent-dark: #1a3c9e;
  --accent-soft: #e8eefc;
  --teal: #0f8b8d;
  --border: #e3e6ee;
  --panel: #f7f8fc;
  --sidebar-w: 270px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16.5px;
  line-height: 1.7;
}

/* ---------- Two-column page layout ---------- */
.wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  column-gap: 72px;
}

/* ---------- Left sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  padding: 48px 0 32px;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.side-name {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.42rem;
  line-height: 1.25;
  margin: 0 0 16px;
}
.side-name a { color: var(--accent); border-bottom: 0; }

.portrait-link { display: block; border-bottom: 0; }
.portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(30, 45, 90, 0.12);
}

.side-role {
  margin: 16px 0 2px;
  font-weight: 600;
  color: #1c2233;
}
.side-affil {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.contact-links { display: flex; gap: 8px; }
.contact-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.contact-links a:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); }
.contact-links svg { width: 18px; height: 18px; }
.contact-links a[title="Email"] svg { fill: #d44638; }
.contact-links a[title="Google Scholar"] svg { fill: #4285f4; }
.contact-links a[title="LinkedIn"] svg { fill: #0a66c2; }
.contact-links a[title="GitHub"] svg { fill: #181717; }

.side-email { margin: 10px 0 0; font-size: 0.85rem; word-break: break-all; }
.side-email a { color: var(--muted); border-bottom: 0; }
.side-email a:hover { color: var(--accent); }

.side-nav {
  display: flex;
  flex-direction: column;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.side-nav a {
  display: block;
  padding: 7px 12px;
  margin-bottom: 2px;
  border-bottom: 0;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.side-nav a:hover { background: var(--panel); color: var(--accent); }
.side-nav a.active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); }

/* ---------- Right content column ---------- */
.content {
  padding: 48px 0 32px;
  min-width: 0;
}
.content > h1:first-child { display: none; }  /* name already shown in the sidebar */
.content > h2:first-child,
.content > h1:first-child + h2 { margin-top: 0; }

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; color: #1c2233; }
h2 {
  font-size: 1.5rem;
  margin: 46px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  line-height: 1.3;
  scroll-margin-top: 24px;
}
p { margin: 0 0 14px; }
strong { color: #1c2233; }
em { color: var(--muted); }
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(47, 91, 211, 0.25); }
a:hover { border-bottom-color: var(--accent); }
hr { display: none; }

/* ---------- General lists ---------- */
ul { padding-left: 22px; }
li { margin-bottom: 6px; }
li::marker { color: var(--accent); }

/* ---------- Research interests as tags ---------- */
#research-interests + ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
#research-interests + ul li {
  background: var(--accent-soft);
  color: #23408f;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
}

/* ---------- Publications ---------- */
#publications + ul { list-style: none; padding: 0; }
#publications + ul li {
  padding: 14px 18px;
  margin-bottom: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
#publications + ul li p { margin: 0; }
#publications + ul li strong { display: block; margin-bottom: 4px; }
#publications + ul li:has(> p > a:first-child):hover { box-shadow: 0 6px 18px rgba(30, 45, 90, 0.10); transform: translateY(-1px); }

/* Linked paper titles: blue, underlined, pointer icon */
#publications + ul li > p > a:first-child { display: inline; color: var(--text); border-bottom: 0; cursor: pointer; }
#publications + ul li > p > a:first-child strong {
  display: inline;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-thickness 0.15s ease;
}
#publications + ul li > p > a:first-child:hover strong {
  color: var(--accent-dark);
  text-decoration-thickness: 2px;
  background: var(--accent-soft);
  border-radius: 3px;
}
.nowrap { white-space: nowrap; }
.click-icon {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  margin-left: 6px;
  vertical-align: -0.15em;
  background-color: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 2.5l13.5 10.2-5.7.9 3.4 6.6-2.7 1.4-3.4-6.6-4.1 4.2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 2.5l13.5 10.2-5.7.9 3.4 6.6-2.7 1.4-3.4-6.6-4.1 4.2z'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.15s ease;
}
#publications + ul li > p > a:first-child:hover .click-icon { background-color: var(--accent-dark); transform: translate(2px, -1px) scale(1.15); }

/* ---------- Experience table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
  padding: 8px 10px;
}
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
td:first-child { white-space: nowrap; color: var(--teal); font-weight: 500; }
tr:hover td { background: var(--panel); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Paper article pages ---------- */
.article .paper-head { text-align: center; padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.article .venue {
  display: inline-block;
  background: var(--accent-soft);
  color: #23408f;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.article .paper-head h1 { font-size: 2.05rem; line-height: 1.25; margin: 0 0 14px; }
.article .authors { color: var(--muted); margin: 0 0 4px; }
.article .authors strong { color: var(--text); }
.article .affil-line { color: var(--muted); font-size: 0.92rem; margin: 0 0 20px; }
.buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.buttons a {
  display: inline-block;
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}
.buttons a.primary { background: var(--accent); color: #fff; }
.buttons a.primary:hover { background: #2349b0; }
.buttons a:hover { background: var(--accent-soft); }

.tldr { margin: 28px 0 8px; padding: 18px 22px; background: #f1f8f8; border-left: 4px solid var(--teal); border-radius: 8px; }
.tldr p { margin: 0; }

figure { margin: 26px 0; text-align: center; }
figure img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
figure.narrow img { max-width: 440px; width: 100%; }
figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.fig-row { display: flex; gap: 18px; align-items: flex-end; justify-content: center; }
.fig-row > div { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 22px 0; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.stat .num { font-family: "Source Serif 4", Georgia, serif; font-size: 1.8rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.stat .lbl { font-size: 0.85rem; color: var(--muted); line-height: 1.4; margin-top: 4px; }

pre {
  background: #f4f6fb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ---------- Shorter laptop screens: keep the whole sidebar visible ---------- */
@media (min-width: 901px) and (max-height: 900px) {
  .sidebar { padding-top: 32px; }
  .portrait { width: 200px; }
  .side-role { margin-top: 12px; }
  .side-nav { margin-top: 16px; padding-top: 12px; }
  .side-nav a { padding: 5px 12px; }
  .content { padding-top: 32px; }
}

/* ---------- Tablets and phones: stack the columns ---------- */
@media (max-width: 900px) {
  .wrapper { display: block; padding: 0 20px; }
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 28px 0 0;
    text-align: center;
  }
  .side-name { font-size: 1.5rem; }
  .portrait { width: 180px; margin: 0 auto; }
  .contact-links { justify-content: center; }
  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    margin: 18px -20px 0;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
  }
  .side-nav a { border-left: 0; border-radius: 999px; padding: 4px 10px; font-size: 0.85rem; margin: 0; }
  .side-nav a.active { background: var(--accent); color: #fff; }
  .content { padding-top: 24px; }
  .fig-row { flex-direction: column; }
  .article .paper-head h1 { font-size: 1.6rem; }
  td:first-child { white-space: normal; }
}
