/* ============================================================
   Chaitanya Srinivasan — personal site
   Hand-written CSS. No frameworks, no webfont CDNs (GDPR),
   no build step. Edit directly.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --paper:       #fcfcfd;
  --paper-2:     #f2f3f6;
  --ink:         #14161a;
  --ink-2:       #454b57;
  --ink-3:       #767d8c;
  --rule:        #e4e6eb;
  --accent:      #17607a;
  --accent-tint: #e7f0f3;
  --accent-line: #a9cbd6;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: 78px;
  --pad:    20px;
  --measure: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:       #0e1013;
    --paper-2:     #191c22;
    --ink:         #e8eaee;
    --ink-2:       #a9b0bc;
    --ink-3:       #79808d;
    --rule:        #272b33;
    --accent:      #74bcd3;
    --accent-tint: #14282f;
    --accent-line: #33606f;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 76px 26px 88px;
}

p { margin: 0 0 0.85em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: var(--accent-line);
  transition: text-decoration-color 120ms ease;
}
a:hover { text-decoration-color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   HEADER
   ============================================================ */
.intro {
  display: flex;
  align-items: flex-start;
  gap: 30px;
}

.portrait {
  /* 2:3, matching the source staff portrait */
  flex: 0 0 116px;
  width: 116px;
  height: 174px;
  margin-top: 24px;
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* graceful fallback if images/portrait.jpg is not there yet */
.portrait.is-missing img { display: none; }
.portrait.is-missing::after {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.intro-text { flex: 1 1 auto; min-width: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
}

h1 {
  font-size: 32px;
  font-weight: 620;
  letter-spacing: -0.021em;
  line-height: 1.15;
  margin: 0 0 18px;
}

.intro-text p { color: var(--ink-2); }

.intro-aside {
  color: var(--ink-2);
  border-left: 2px solid var(--accent-line);
  padding-left: 14px;
  margin-top: 16px;
}

.links {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
}
.links a { text-decoration: none; padding: 3px 11px 3px 0; margin-right: 11px; border-right: 1px solid var(--rule); }
.links a:last-child { border-right: 0; margin-right: 0; }
.links a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* ============================================================
   SECTIONS
   ============================================================ */
section { margin-top: 62px; }

.section-label {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 22px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--rule);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--rule);
}
.section-head .section-label { margin-bottom: 0; border-bottom: 0; padding-bottom: 0; }

.sub-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 34px 0 14px;
}
.sub-label:first-of-type { margin-top: 0; }

.lede { color: var(--ink-2); margin-bottom: 26px; }

.note-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin: 0 0 26px;
}

/* ---------- research themes ---------- */
.theme { margin-bottom: 26px; }
.theme:last-child { margin-bottom: 0; }
.theme h3 {
  font-size: 16.5px;
  font-weight: 640;
  letter-spacing: -0.005em;
  margin: 0 0 6px;
}
.theme p { color: var(--ink-2); margin: 0; }

/* ============================================================
   THE AXIS — shared by news, background, publications
   ============================================================ */
.entries { list-style: none; margin: 0; padding: 0; }

.entry,
.pub {
  display: grid;
  grid-template-columns: var(--gutter) 1fr;
  margin-bottom: 18px;
}
.entry:last-child, .pub:last-child { margin-bottom: 0; }

.entry-when,
.pub-when {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  text-align: right;
  padding: 5px var(--pad) 0 0;
  white-space: nowrap;
}

.entry-what,
.pub-body {
  border-left: 1px solid var(--rule);
  padding-left: var(--pad);
  min-width: 0;
}

.entry-what { color: var(--ink-2); }

/* ---------- publications ---------- */
.pub { margin-bottom: 26px; }

.pub-body h3 {
  font-size: 16.5px;
  font-weight: 620;
  line-height: 1.4;
  letter-spacing: -0.006em;
  margin: 0 0 4px;
}
.pub-body h3 a { color: var(--ink); text-decoration-color: transparent; }
.pub-body h3 a:hover { text-decoration-color: var(--accent); }

.authors {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 0 0 5px;
}
.authors b { color: var(--ink-2); font-weight: 650; }

/* marker on abbreviated consortium author lists */
.n-auth {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0 5px;
  white-space: nowrap;
}

.pub-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  margin: 0 0 7px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}
.pub-meta .venue { color: var(--ink-2); }
.pub-meta a { text-decoration: none; }
.pub-meta a:hover { text-decoration: underline; }

.pub-meta .role {
  color: var(--accent);
  background: var(--accent-tint);
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pub-note {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}

/* ---------- selected / all switch ---------- */
.switch {
  display: flex;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  flex: 0 0 auto;
}
.switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.switch button:hover { color: var(--ink); }
.switch button.is-on { background: var(--paper-2); color: var(--ink); }

.pubs.is-filtered .pub { display: none; }
.pubs.is-filtered .pub.is-selected { display: grid; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}
footer p { margin: 0 0 5px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  :root { --gutter: 62px; --pad: 15px; }
  .page { padding: 48px 20px 64px; }
  h1 { font-size: 27px; }
  .intro { gap: 22px; }
  .portrait { flex-basis: 94px; width: 94px; height: 141px; margin-top: 20px; }
}

@media (max-width: 560px) {
  .intro { flex-direction: column; gap: 20px; }
  .portrait { margin-top: 0; flex-basis: 108px; width: 108px; height: 162px; }

  .entry, .pub { grid-template-columns: 1fr; }

  .entry-when, .pub-when {
    text-align: left;
    padding: 0 0 3px 0;
  }
  .entry-when br, .pub-when br { display: none; }

  .entry-what, .pub-body { border-left: 0; padding-left: 0; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ============================================================
   MOTION
   ============================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.page > * { animation: rise 420ms cubic-bezier(.22,.61,.36,1) both; }
.page > *:nth-child(2) { animation-delay: 60ms; }
.page > *:nth-child(3) { animation-delay: 100ms; }
.page > *:nth-child(4) { animation-delay: 130ms; }
.page > *:nth-child(n+5) { animation-delay: 150ms; }

@media (prefers-reduced-motion: reduce) {
  .page > * { animation: none; }
  * { transition: none !important; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .switch, .portrait { display: none; }
  .pubs.is-filtered .pub { display: grid; }
  body { background: #fff; color: #000; font-size: 10pt; }
  a { color: #000; text-decoration: none; }
}
