/* Dr. S. Prabhu - classic academic homepage.
   Deliberately small: no framework, no webfonts, no JavaScript. */

:root {
  color-scheme: light;
  --ink: #1c1c22;
  --accent: #12246b;          /* the dark blue of a traditional department page */
  --accent-soft: #2c47a8;
  --accent-hover: #0b1746;
  --visited: #4b2a7a;
  --muted: #5d5d68;
  --rule: #d8d5cc;
  --hairline: #e7e4db;
  --paper: #fffdf9;           /* the sheet */
  --ground: #e8e5dc;          /* the desk the sheet lies on */
  --tint: #f5f3ec;
  --gold: #b08442;            /* one warm accent, used sparingly */
}

* { box-sizing: border-box; }

html {
  background: var(--ground);
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255, 253, 249, 0.85) 0%, transparent 70%),
    radial-gradient(circle at 100% 8%, rgba(176, 132, 66, 0.10) 0%, transparent 42%),
    radial-gradient(circle at 0% 92%, rgba(18, 36, 107, 0.08) 0%, transparent 45%),
    url("graph-bg.svg");
  background-size: auto, auto, auto, 84px 150px;
  background-attachment: fixed;
}

body {
  margin: 0 auto;
  max-width: 68rem;
  background: var(--paper);
  color: var(--ink);
  /* Palatino, through every name it goes by; P052 is the URW clone on Linux. */
  font: 17px/1.7 "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L",
        P052, Palladio, Georgia, serif;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  box-shadow: 0 1px 2px rgba(28, 28, 34, 0.05), 0 12px 32px -12px rgba(28, 28, 34, 0.22);
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 72rem) {
  body { margin-block: 2.5rem 3rem; }
}

/* ------------------------------------------------------------- masthead */
.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2.5rem;
  padding: 2rem 2.5rem 1.5rem;
  background-color: var(--tint);
  background-image:
    linear-gradient(180deg, rgba(245, 243, 236, 0.92) 0%, rgba(255, 253, 249, 0.99) 100%),
    url("graph-bg.svg");
  background-size: auto, 70px 125px;
  border-bottom: 1px solid var(--rule);
}

.identity h1 {
  margin: 0;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.005em;
}

.identity .address,
.identity .email {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
}

.identity .email a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.identity .email .mail {
  flex: none;
  color: var(--muted);
  transform: translateY(0.5px);
}

.identity .email a:hover .mail,
.identity .email a:focus-visible .mail { color: var(--accent-hover); }

.identity .address {
  padding-top: 0.7rem;
  border-top: 1px solid var(--hairline);
}

.identity .email { margin-bottom: 0; font-weight: bold; }

.portrait {
  flex: none;
  width: 150px;
  height: auto;            /* the full frame, uncropped */
  border: 1px solid var(--rule);
  background: var(--tint);
  box-shadow: 0 2px 10px -3px rgba(28, 28, 34, 0.3);
}

/* ----------------------------------------------------------- profile bar */
.profile-bar {
  background: linear-gradient(180deg, var(--paper) 0%, var(--tint) 100%);
  border-bottom: 1px solid var(--rule);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.profiles {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0.3rem 1.25rem;
  list-style: none;
}

.profiles li { flex: 1 1 auto; min-width: 0; }

.badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: background-color 0.14s, border-color 0.14s;
}

.badge:hover,
.badge:focus-visible {
  background: color-mix(in srgb, var(--brand, #12246b) 10%, transparent);
  border-bottom-color: var(--brand, var(--accent));
}

.badge:focus-visible { outline-offset: -2px; }

.badge .mark {
  flex: none;
  display: block;
  width: 26px;
  height: 26px;
}

.badge-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1.3;
}

.badge.solo .badge-name { font-size: 0.84rem; }

.badge-name {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-id {
  color: var(--muted);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* -------------------------------------------------------------- columns */
.columns {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 2.75rem;
  padding: 2rem 2.5rem 2.75rem;
}

.columns > nav {
  align-self: start;
  padding: 1rem 1.1rem;
  background: var(--tint);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
}

@media (min-width: 48.0625rem) {
  .columns > nav { position: sticky; top: 1.5rem; }
}

.columns > nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.columns > nav li { margin-bottom: 0.15rem; }

.columns > nav a {
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  font-size: 0.95rem;
  text-decoration: none;
}

.columns > nav a:hover,
.columns > nav a:focus-visible {
  background: #fff;
  text-decoration: underline;
}

.columns > nav [aria-current="page"] {
  background: var(--accent);
  color: #fff;
}

.columns > nav [aria-current="page"]:hover {
  background: var(--accent-hover);
  color: #fff;
}

.columns > nav strong { font-weight: normal; }

.nav-extra {
  margin: 0.9rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------- content */
main { min-width: 0; }

/* Justified, with hyphenation on — without it the long journal names and DOIs
   in the publication list open rivers of whitespace. Headings, navigation and
   the profile bar stay ranged left. */
main p,
main .cv-list li {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

main > :first-child { margin-top: 0; }

h2 {
  margin: 2.25rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--accent);
  font-size: 1.15rem;
  letter-spacing: -0.005em;
}

main > h2:first-of-type { margin-top: 0; }

p { max-width: 44em; margin: 0 0 0.9rem; }

.lead {
  margin-bottom: 1.75rem;
  padding: 0.9rem 1.1rem;
  background: var(--tint);
  border-left: 3px solid var(--gold);
  border-radius: 0 3px 3px 0;
  color: #4a4a54;
  font-size: 1.02rem;
}

.cv-list {
  margin: 0 0 1.3rem;
  padding-left: 1.5rem;
  max-width: 52em;
}

.cv-list li { margin-bottom: 0.55rem; }

.cv-list li::marker { color: var(--accent-soft); }

.cv-list.dated li { margin-bottom: 0.85rem; }

.cv-list.dated em { color: var(--muted); font-style: normal; }

/* A CV record over two lines: what and when, then where, quieter and smaller.
   The appointments, the degrees and the completed Ph.D.s all take this shape. */
.cv-list .role,
.cv-list .where,
.cv-list .thesis,
.cv-list .topic { display: block; }

/* the period moves as one piece: better a whole date on the next line than
   "30 Sept" on one and "2025" on the next */
.cv-list .when { color: var(--muted); font-size: 0.88em; white-space: nowrap; }
.cv-list .when::before { content: " \00b7  "; }

.cv-list .where,
.cv-list .thesis,
.cv-list .topic {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.88em;
}

/* The thesis titles are set in capitals. They want a little tracking, and they
   must not be justified: capitals have no descender-and-ascender variety to
   disguise the gaps, so a justified wrapped line opens rivers a word wide. */
.cv-list .thesis {
  letter-spacing: 0.015em;
  text-align: left;
  hyphens: none;
  -webkit-hyphens: none;
}

/* The current scholars' topics sit directly below that list and must read as
   its match, so they range left too - but they are mixed case and want none of
   the tracking that the capitals need. */
.cv-list .topic { text-align: left; }

.publication-list {
  font-size: 0.95rem;
  max-width: 54em;
}

.publication-list li {
  margin-bottom: 0;
  padding: 0.6rem 0 0.6rem 0.35rem;
  border-bottom: 1px solid var(--hairline);
}

.publication-list li:last-child { border-bottom: 0; }

.publication-list li:hover { background: var(--tint); }

.publication-list a { word-break: break-word; }

.profile-links { white-space: nowrap; font-size: 0.9em; }

/* ----------------------------------------------------------------- links */
a { color: var(--accent-soft); }

a:visited { color: var(--visited); }

a:hover,
a:focus-visible { color: var(--accent-hover); }

a:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- footer */
footer {
  padding: 1.1rem 2.5rem 1.3rem;
  background: var(--tint);
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

footer p { margin: 0; max-width: none; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 48rem) {
  body { border-left: 0; border-right: 0; }

  .masthead {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .identity .address { border-top: 0; padding-top: 0; }

  .profiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 0;
  }

  .badge { padding: 0.6rem 0.75rem; }

  .columns {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 1.25rem 2rem;
  }

  .columns > nav { border-left-width: 1px; border-top: 3px solid var(--accent); }

  .columns > nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .columns > nav li { margin: 0; }

  footer { padding-inline: 1.25rem; }

  .profile-links { white-space: normal; }

  /* too few words per line for justification to look like anything but gaps */
  main p,
  main .cv-list li { text-align: left; }

  /* No room for the period beside the designation, and a middot left stranded
     at the head of a wrapped line reads as a bullet. Give it its own line. */
  .cv-list .when { display: block; }
  .cv-list .when::before { content: none; }
}

@media (prefers-reduced-motion: reduce) {
  .badge { transition: none; }
  .badge:hover, .badge:focus-visible { transform: none; }
}

/* ---------------------------------------------------------------- print */
@media print {
  html { background: #fff; }

  body {
    max-width: none;
    margin: 0;
    border: 0;
    box-shadow: none;
    background: #fff;
    font-size: 10.5pt;
    color: #000;
  }

  .masthead {
    background: #fff;
    padding: 0 0 0.5rem;
    border-bottom: 1.5pt solid #000;
  }

  .identity h1, h2 { color: #000; }

  /* grey prints badly; both lines of a record go black on paper */
  .cv-list .when, .cv-list .where,
  .cv-list .thesis, .cv-list .topic { color: #000; }

  .identity .email .mail { display: none; }

  .columns > nav, .nav-extra, .portrait { display: none; }

  .columns { display: block; padding: 1rem 0 0; }

  .lead { background: #fff; border-left: 1pt solid #000; }

  /* the IDs still matter on paper; the logos do not */
  .profile-bar { background: #fff; border: 0; box-shadow: none; }
  .profiles { display: block; padding: 0.5rem 0 0; columns: 2; }
  .badge { display: block; padding: 0.1rem 0; border: 0; }
  .badge .mark { display: none; }
  .badge-text { display: inline; }
  .badge-name::after { content: ": "; }
  .badge-id { font-size: 10pt; }

  a { color: #000; text-decoration: none; }

  .publication-list li { border-bottom: 0; padding: 0.15rem 0; }

  h2 { break-after: avoid; }

  .cv-list li { break-inside: avoid; }

  footer {
    background: #fff;
    padding: 0.6rem 0 0;
    border-top: 0.5pt solid #000;
  }
}
