/* ============================================================
   B. Srivathsan — academic homepage
   Palette: cool paper white, ink, deep slate-teal accent, muted
   amber for honors. Display serif for headings, book serif for
   body, mono for meta/data (dates, rooms, venues) — a small nod
   to the formal-methods subject matter.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root{
  --paper:      #F7F7F3;
  --paper-dim:  #EFEFE9;
  --ink:        #1B1D1F;
  --ink-soft:   #4B4F54;
  --rule:       #DCDAD1;
  --accent:     #2E5266;   /* deep slate teal */
  --accent-soft:#5C7E90;
  --honor:      #A47C3B;   /* muted amber, awards only */

  --serif-display: 'Fraunces', 'Source Serif 4', Georgia, serif;
  --serif-body: 'Source Serif 4', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*{ box-sizing: border-box; }

::selection{ background: var(--accent); color: var(--paper); }

html{
  scroll-behavior: smooth;
  font-size: 118.75%; /* 19px base — all rem-sized text below scales from this */
}

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 1rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a{
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition: color .15s ease, border-color .15s ease;
}
a:hover, a:focus-visible{ color: var(--honor); border-color: var(--honor); }
a:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 1px; }

.container{
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* ---------- header ---------- */

header{
  display: flex;
  gap: 36px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}

.profile{ flex: 1; min-width: 0; }

h1{
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 2.1rem;
  letter-spacing: -.01em;
  margin: 0 0 6px;
}

.position{
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .02em;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 18px;
}
.position a{ color: var(--ink-soft); border-color: var(--rule); }
.position a:hover{ color: var(--accent); border-color: var(--accent); }

.summary p{
  margin: 0 0 20px;
  font-size: 1.02rem;
  max-width: 60ch;
}
.summary strong{ font-weight: 600; color: var(--ink); }

.links{
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-bottom: 22px;
  font-family: var(--mono);
  font-size: .84rem;
}
.links a{ border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.links a:hover{ border-color: var(--honor); }

table.contact{
  border-collapse: collapse;
  font-size: .88rem;
  color: var(--ink-soft);
}
table.contact td{
  padding: 2px 12px 2px 0;
  vertical-align: top;
}
table.contact td:first-child{
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-soft);
  padding-top: 5px;
  white-space: nowrap;
}

.photo{
  width: 168px;
  height: 168px;
  object-fit: cover;
  object-position: 50% 4%;
  border-radius: 3px;
  filter: grayscale(15%);
  flex-shrink: 0;
}

/* ---------- nav ---------- */

nav{
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 14px 0;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 10;
}
nav a{ border-bottom: 1px solid transparent; color: var(--ink-soft); }
nav a:hover{ color: var(--accent); border-color: var(--accent); }

/* ---------- sections ---------- */

section{ margin-bottom: 46px; scroll-margin-top: 56px; }

h2{
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 18px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
h2::before{
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}

h3{
  font-family: var(--serif-body);
  font-style: italic;
  font-weight: 600;
  font-size: 1.02rem;
  margin: 24px 0 10px;
  color: var(--ink-soft);
}

p{ margin: 0 0 14px; }

ul{ margin: 0 0 14px; padding-left: 0; list-style: none; }
ul li{
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
}
ul li::before{
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent-soft);
  font-family: var(--mono);
  font-size: .85em;
}

section#research ul li::before,
section#teaching ul li::before{ content: "·"; font-size: 1.4em; top: -.15em; }

ul.news li{ padding-left: 0; }
ul.news li::before{ content: none; }
ul.news li{
  padding: 10px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: .96rem;
}
ul.news li:last-child{ border-bottom: none; }
ul.news li strong{
  display: block;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 3px;
}

section#awards ul li::before{ content: "★"; color: var(--honor); font-size: .8em; top: .05em; }
section#awards ul li strong{ font-family: var(--mono); color: var(--honor); font-weight: 500; }

/* selected publications */

.selected-paper{
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.selected-paper:last-of-type{ border-bottom: none; }
.paper-title{
  font-weight: 600;
  margin-bottom: 5px;
  line-height: 1.4;
}
.badge{
  display: inline-block;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--honor);
  border: 1px solid var(--honor);
  border-radius: 20px;
  padding: 2px 9px;
  margin-left: 10px;
  vertical-align: middle;
}
.paper-venue{
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--ink-soft);
}

/* background table reused */
section#background table.contact td:first-child{ min-width: 100px; }
section#background table.contact td{ padding-bottom: 16px; }

footer{
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
footer a{ color: var(--ink-soft); border-color: var(--rule); }

/* ---------- sub-pages (publications / students / service / teaching) ---------- */

.page-header{
  padding-bottom: 24px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}
.page-header .back{
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--ink-soft);
  border: none;
}
.page-header .back:hover{ color: var(--accent); }
.page-header h1{ margin-top: 10px; font-size: 1.7rem; }

.pub-list{ list-style: none; margin: 0 0 8px; padding: 0; }
.pub-list li{
  padding: 12px 0 12px 44px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  font-size: .97rem;
}
.pub-num{
  position: absolute;
  left: 0;
  top: 12px;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--accent-soft);
}
.pub-list li:last-child{ border-bottom: none; }
.pub-authors{ color: var(--ink-soft); }
.pub-venue{ font-family: var(--mono); font-size: .84rem; color: var(--accent); }

.student-card{
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.student-card:last-child{ border-bottom: none; }
.student-name{ font-weight: 600; }
.student-meta{ font-family: var(--mono); font-size: .82rem; color: var(--ink-soft); }
.student-thesis{ font-style: italic; color: var(--ink-soft); margin-top: 2px; }

.service-year{
  font-family: var(--mono);
  color: var(--accent-soft);
  font-size: .84rem;
}

@media (max-width: 560px){
  header{ flex-direction: column-reverse; }
  .photo{ width: 124px; height: 124px; }
  .container{ padding: 36px 18px 60px; }
  nav{ gap: 6px 16px; top: 0; }
}
