/* ============================================================
   Ghadiyaram Lab — v5 · academic edition (people-first)
   Paper white · ink · BU scarlet accent.
   ============================================================ */

:root {
  --paper:    #fbfaf8;
  --paper-2:  #f4f2ed;
  --card:     #ffffff;
  --ink:      #1a1a1a;
  --ink-2:    #555150;
  --ink-3:    #8a847f;
  --line:     #e7e3dc;
  --line-2:   #d8d2c8;
  --scarlet:  #cc0000;
  --scarlet-d:#a30000;
  --scarlet-soft: #fbeaea;

  --maxw: 1100px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28,25,23,.04), 0 10px 30px rgba(28,25,23,.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--scarlet-d); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
em { font-style: italic; color: var(--ink); }
strong { font-weight: 600; }

/* ── Navigation ───────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,250,248,.82); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .25s ease;
}
.nav.is-stuck { border-color: var(--line); }
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 600; }
.nav__brand:hover { text-decoration: none; }
.nav__mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--scarlet); color: #fff; font-family: var(--serif); font-size: 19px; line-height: 1;
}
.nav__name { font-size: 16px; letter-spacing: -.01em; }
.nav__links { display: flex; gap: 28px; }
.nav__links a { color: var(--ink-2); font-size: 14.5px; font-weight: 500; position: relative; padding: 4px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--scarlet); transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.nav__links a:hover { color: var(--ink); text-decoration: none; }
.nav__links a:hover::after, .nav__links a.active::after { transform: scaleX(1); }
.nav__links a.active { color: var(--ink); }
.nav__burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__burger span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; transition: .25s; }

/* ── Layout primitives ────────────────────── */
.section { max-width: var(--maxw); margin: 0 auto; padding: 76px 24px; }
.section--tint {
  max-width: none; background: var(--paper-2);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.section--tint > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }

.head { margin-bottom: 40px; }
.kicker {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--scarlet); margin-bottom: 10px;
}
.head__title { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.05; letter-spacing: -.015em; margin: 0; }
.head__sub { color: var(--ink-2); font-size: 16px; margin: 14px 0 0; }

/* ── Hero + PI ────────────────────────────── */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(56px, 9vw, 104px) 24px clamp(48px, 7vw, 84px);
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: center;
}
.hero__eyebrow { font-size: 13px; font-weight: 600; color: var(--ink-3); margin: 0 0 20px; }
.hero__title {
  font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05; letter-spacing: -.02em; margin: 0;
}
.hero__title .u {
  background-image: linear-gradient(var(--scarlet), var(--scarlet));
  background-repeat: no-repeat; background-position: 0 94%; background-size: 100% 2px;
}
.hero__lede { margin: 24px 0 0; font-size: 19px; color: var(--ink-2); }
.hero__cta { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero__image { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600;
  padding: 11px 22px; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--solid { background: var(--scarlet); color: #fff; }
.btn--solid:hover { background: var(--scarlet-d); }
.btn--line { color: var(--ink); border-color: var(--line-2); background: var(--card); }
.btn--line:hover { border-color: var(--ink); }

/* ── People (centerpiece) ─────────────────── */
.people-block { margin-bottom: 56px; }
.people-block:last-child { margin-bottom: 0; }
.people-block__title {
  font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 26px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.pgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 20px; }
.pgrid--lg { grid-template-columns: repeat(4, 1fr); gap: 40px 24px; }

.pcard { text-align: center; }
.pavatar {
  width: 112px; height: 112px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 38px;
  background-size: cover; background-position: center 25%;
  box-shadow: 0 0 0 5px #fff, 0 0 0 6px var(--line); transition: transform .2s ease, box-shadow .2s ease;
}
a.pavatar:hover { text-decoration: none; }
.pgrid:not(.pgrid--lg) .pavatar { width: 88px; height: 88px; font-size: 30px; }
.pcard:hover .pavatar { transform: translateY(-4px); box-shadow: 0 0 0 5px #fff, 0 0 0 6px var(--scarlet), 0 12px 24px rgba(28,25,23,.12); }
.pcard__name { font-weight: 600; font-size: 17px; letter-spacing: -.01em; line-height: 1.25; }
.pcard__meta { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.pcard__note { font-size: 13.5px; color: var(--ink-2); margin: 7px auto 0; max-width: 24ch; line-height: 1.4; }
.pcard__co { font-size: 12px; color: var(--ink-3); font-style: italic; margin-top: 5px; }
.pcard__links { margin-top: 9px; display: flex; gap: 12px; justify-content: center; }
.pcard__links a { font-size: 13px; font-weight: 500; }

/* ── Publications (visual card grid) ──────── */
.pubgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.pubcard {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease;
}
.pubcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }

.pubcard__fig {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: #fff; border-bottom: 1px solid var(--line);
  display: grid; place-items: center;
}
.pubcard__fig[data-full] { cursor: zoom-in; }
/* contain (not cover) so paper figures are never cropped */
.pubcard__media {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; padding: 14px; transition: transform .35s ease;
}
/* tall figures: show the top (usually the visual part); lightbox shows the whole */
.pubcard__fig.is-top .pubcard__media { object-fit: cover; object-position: center top; padding: 0; }
.pubcard:hover .pubcard__media { transform: scale(1.03); }
.pubcard__zoom {
  position: absolute; right: 12px; bottom: 12px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px; color: var(--ink);
  background: rgba(255,255,255,.92); box-shadow: 0 1px 6px rgba(0,0,0,.15);
  opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease;
}
.pubcard:hover .pubcard__zoom, .pubcard__fig:focus-visible .pubcard__zoom { opacity: 1; transform: none; }

.pubgrid.is-collapsed .is-extra { display: none; }
.pubmore { display: flex; margin: 32px auto 0; cursor: pointer; font-family: inherit; }

/* Figure lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 4vmin;
  background: rgba(20,18,17,.82); backdrop-filter: blur(4px); cursor: zoom-out;
  animation: lbIn .2s ease;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(1200px, 100%); max-height: 88vh; background: #fff;
  border-radius: 10px; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.4); cursor: default;
}
.lightbox__close {
  position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.lightbox__close:hover { background: rgba(255,255,255,.28); }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

/* Keyboard focus */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--scarlet); outline-offset: 3px; border-radius: 6px;
}
.pavatar:focus-visible { border-radius: 50%; }
.pubcard__fig.is-empty {
  background: linear-gradient(135deg, var(--scarlet-soft), var(--paper-2));
}
.pubcard__ph { font-family: var(--serif); font-size: 40px; font-weight: 600; color: var(--scarlet-d); opacity: .5; }
.pubcard__badge {
  position: absolute; top: 12px; left: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  color: #fff; background: var(--scarlet); border-radius: 999px; padding: 4px 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.pubcard__body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.pubcard__venue { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--scarlet-d); }
.pubcard__title { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; margin: 8px 0 8px; }
.pubcard__title a { color: var(--ink); }
.pubcard__title a:hover { color: var(--scarlet-d); }
.pubcard__authors { font-size: 13.5px; color: var(--ink-2); margin: 0 0 14px; line-height: 1.45; }
.pubcard__links { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pubcard__links a {
  font-size: 12.5px; font-weight: 600; padding: 5px 13px;
  border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink);
}
.pubcard__links a:hover { background: var(--scarlet); color: #fff; border-color: var(--scarlet); text-decoration: none; }

/* ── Footer ───────────────────────────────── */
.footer { border-top: 1px solid var(--line); background: var(--paper-2); }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 36px 24px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand strong { display: block; font-size: 15px; }
.footer__brand span { font-size: 13px; color: var(--ink-3); }
.footer__links { display: flex; gap: 20px; }
.footer__links a { font-size: 14px; color: var(--ink-2); }
.footer__fine { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 32px; font-size: 13px; color: var(--ink-3); }

/* ── Back to top ──────────────────────────── */
.totop {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 42px; height: 42px; border-radius: 50%;
  background: var(--ink); color: #fff; border: 0; cursor: pointer; font-size: 18px;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; box-shadow: var(--shadow);
}
.totop.show { opacity: 1; pointer-events: auto; }
.totop:hover { transform: translateY(-2px); }

/* ── Reveal on scroll ─────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .hero__cta { justify-content: center; }
  .pgrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav__links {
    position: fixed; inset: 60px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px; transform: translateY(-130%); transition: transform .3s ease;
  }
  .nav__links.open { transform: none; }
  .nav__links a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav__links a::after { display: none; }
  .nav__burger { display: block; }
  .pgrid, .pgrid--lg { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .pgrid .pavatar, .pgrid--lg .pavatar { width: 92px; height: 92px; font-size: 30px; }
  .pubgrid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
