/* Site styles for index, publications, and studio.
   Type and layout follow cs.jhu.edu/~cmhuang: Source Serif 4 + Libre Franklin, warm paper, one accent. */

:root {
  --paper: #FBFAF8;
  --tile: #F2EFE9;
  --ink: #1C1C1A;
  --ink-2: #4A4A46;
  --muted: #6E6C66;
  --hairline: #DEDCD4;
  --line-strong: #CFCBC2;
  --accent: #185690;
  --accent-soft: #E8EEF6;
  --rose: #9B3F5C;
  --rose-soft: #F7EDF0;
  --link: #185690;
  --gold: #B07D0A;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Libre Franklin', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Layout ─────────────────────────────── */
.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 56px 32px 0;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr) 300px;
  gap: 52px;
}
.shell.page { grid-template-columns: 228px minmax(0, 1fr); max-width: 1180px; }

/* ── Rail ───────────────────────────────── */
.rail { position: sticky; top: 56px; align-self: start; }
img.portrait { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 30%; border-radius: 6px; }
.rail .name { margin: 16px 0 0; font-size: 22px; line-height: 1.2; font-weight: 700; }
.alt-name { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); white-space: nowrap; }
[lang="ta"] { font-family: 'Noto Serif Tamil', var(--serif); }
[lang="hi"] { font-family: 'Noto Serif Devanagari', var(--serif); }
.byline { margin: 12px 0 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.rail nav { margin: 20px 0 0; display: flex; flex-direction: column; gap: 3px; font-family: var(--sans); font-size: 13.5px; font-weight: 500; }
.rail nav a { color: var(--muted); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.rail nav a:hover { color: var(--ink); text-decoration-color: var(--muted); }
.rail nav a[aria-current] { color: var(--ink); font-weight: 600; }
.contact { margin: 18px 0 0; font-family: var(--sans); font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.contact a { text-decoration: underline; text-underline-offset: 3px; }
.contact a:hover { color: var(--ink); }

/* ── Shared type ────────────────────────── */
.center, .main { min-width: 0; }
hr { border: none; border-top: 1px solid var(--hairline); margin: 32px 0; }
h2.label {
  margin: 0 0 18px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
section { scroll-margin-top: 32px; }
.prose a { text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose .advisor { text-decoration: underline; text-decoration-color: var(--rose); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* ── Home: intro ────────────────────────── */
.intro p { margin: 0 0 16px; font-size: 17.5px; line-height: 1.55; }
.intro p:first-child::first-letter { font-weight: 900; font-size: 54px; float: left; line-height: .75; padding: 6px 8px 0 0; }

/* ── Home: themes and badges ────────────── */
.theme + .theme { margin-top: 26px; }
.theme .tn { font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.theme h3 { margin: 2px 0 0; font-size: 19px; font-weight: 600; line-height: 1.3; }
.theme p { margin: 4px 0 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.role { margin-left: 6px; font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 7px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color .2s ease;
}
.badge small { font-size: 11px; font-weight: 500; color: var(--muted); }
.badge:hover { border-color: var(--ink); }
.star { color: var(--gold); }
.badge.award { border-color: var(--rose); background: var(--rose-soft); }
.badge.award small { color: var(--rose); font-weight: 600; }
.award-name { color: var(--rose); }

/* ── Home: news, mentoring ──────────────── */
.rows { display: flex; flex-direction: column; gap: 10px; }
.rows div { display: grid; grid-template-columns: 96px 1fr; gap: 14px; font-size: 15.5px; line-height: 1.45; }
.rows .k { font-family: var(--sans); font-size: 12px; color: var(--muted); padding-top: 2px; }
.cols { display: flex; gap: 32px; }
.col { flex: 1; }
.col h3 { margin: 0 0 12px; font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.list { display: flex; flex-direction: column; gap: 9px; font-size: 14.5px; line-height: 1.35; }
.list .d { color: var(--muted); font-size: 12.5px; }
.note { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }

/* ── Home: publications sidebar ─────────── */
.pubs {
  position: sticky;
  top: 56px;
  align-self: start;
  border-left: 1px solid var(--hairline);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 112px);
}
.pubs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-shrink: 0; }
.pubs-head h2 { margin: 0; }
.more { font-family: var(--sans); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.pub-list { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; min-height: 0; padding-right: 4px; }
.pub { font-size: 16px; line-height: 1.35; padding-bottom: 14px; border-bottom: 1px solid var(--hairline); }
.pub:last-child { border-bottom: none; }
.tag { display: block; margin-bottom: 6px; font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.pdf { margin-left: 8px; font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--link); white-space: nowrap; }
.pdf:hover { text-decoration: underline; }
.honor { display: block; margin-top: 3px; font-size: 14px; color: var(--rose); }
.au { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
.au b { color: var(--accent); font-weight: 700; }

/* ── Inner pages ────────────────────────── */
.main { max-width: 860px; }
.page-head h1 { margin: 0; font-size: 34px; line-height: 1.2; font-weight: 700; }
.page-head p { margin: 10px 0 0; color: var(--ink-2); max-width: 64ch; }
.legend { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.legend b { color: var(--accent); font-weight: 700; }
.legend .mentee { font-weight: 600; }

/* ── Publications page ──────────────────── */
.biblio { list-style: none; margin: 0; padding: 0; }
.biblio li { display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--hairline); }
.biblio li:last-child { border-bottom: none; }
.bid { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 3px; }
.btitle { margin: 0; font-size: 17px; line-height: 1.4; font-weight: 600; }
.bauth { margin: 3px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.bauth b { color: var(--accent); font-weight: 700; }
.mentee { color: var(--rose); }
.bvenue { margin: 2px 0 0; font-size: 15px; color: var(--ink-2); }
.bvenue em { font-style: italic; }
.bmeta { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-family: var(--sans); font-size: 12.5px; }
.bmeta a { font-weight: 600; color: var(--link); }
.bmeta a:hover { text-decoration: underline; }
.bmeta .rate { color: var(--muted); }
.bmeta .award { color: var(--rose); font-weight: 700; }
.bmeta .status { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 14px; }
.pub-section { margin-top: 44px; }

/* ── Studio ─────────────────────────────── */
.studio-group { margin-top: 44px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; }
.grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid > .build { grid-column: span 2; }
.grid > .build:first-child:nth-last-child(5),
.grid > .build:first-child:nth-last-child(5) + .build { grid-column: span 3; }
.build { display: flex; flex-direction: column; }
.tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--tile);
  display: grid;
  place-items: center;
}
.tile.photo img { width: 100%; height: 100%; object-fit: cover; }
.tile.duo { grid-template-columns: 1fr 1fr; gap: 3px; }
.tile.duo img { width: 100%; height: 100%; object-fit: cover; }
.tile.cut img { position: absolute; inset: 9% 0; margin: auto; height: 82%; width: auto; max-width: 90%; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(40, 30, 30, .16)); }
.tile.pair { display: flex; align-items: flex-end; justify-content: center; gap: 4%; padding: 0 6% 8%; }
.tile.pair img { height: 80%; width: auto; max-width: 46%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 12px rgba(40, 30, 30, .16)); }
.tile.pair.three img { max-width: 30%; }
.tile.pair.three img:nth-child(2) { height: 70%; }
.tile.strip { padding: 0 12px; }
.tile.strip img { width: 100%; height: auto; border-radius: 6px; mix-blend-mode: multiply; }
.tile.faces { grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 18px; align-content: center; }
.tile.faces img { width: 100%; height: auto; border-radius: 6px; mix-blend-mode: multiply; }
.tile.figure { padding: 12px; }
.tile.figure img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.build h3 { margin: 12px 0 0; font-size: 18px; line-height: 1.3; font-weight: 600; }
.build h3 a:hover { color: var(--accent); }
.build p { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.build .award { margin-top: 6px; font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--rose); }
.build .links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-family: var(--sans); font-size: 12.5px; }
.build .links span { color: var(--muted); }
.build .links a { font-weight: 600; color: var(--link); }
.build .links a:hover { text-decoration: underline; }

/* ── Footer ─────────────────────────────── */
footer.site { max-width: 1320px; margin: 56px auto 0; padding: 20px 32px 56px; border-top: 1px solid var(--hairline); font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
footer.site.page { max-width: 1180px; }

/* ── Responsive ─────────────────────────── */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .pubs { grid-column: 2; position: static; max-height: none; border-left: none; padding-left: 0; border-top: 1px solid var(--hairline); padding-top: 32px; }
  .pub-list { overflow: visible; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid > .build, .grid > .build:first-child:nth-last-child(5), .grid > .build:first-child:nth-last-child(5) + .build { grid-column: auto; }
}
@media (max-width: 760px) {
  .shell, .shell.page { grid-template-columns: 1fr; gap: 32px; padding: 24px 16px 0; }
  .rail { position: static; display: grid; grid-template-columns: 104px 1fr; gap: 0 16px; }
  .rail > :first-child { grid-row: span 3; }
  .rail .name { margin-top: 0; }
  .rail nav, .contact { grid-column: 1 / -1; }
  .rail nav { flex-direction: row; flex-wrap: wrap; gap: 4px 16px; }
  .pubs { grid-column: 1; }
  .cols { flex-direction: column; gap: 20px; }
  .rows div { grid-template-columns: 1fr; gap: 0; }
  .grid { grid-template-columns: 1fr; }
  .biblio li { grid-template-columns: 1fr; gap: 2px; }
  .page-head h1 { font-size: 28px; }
  footer.site { padding: 20px 16px 56px; }
}
