/* ============================================================
   Hemanth Chandravamsi — personal site
   Identity: CFD "coolwarm" diverging colormap on instrument paper.
   ============================================================ */

:root {
  /* palette */
  --ground:   #F5F7FA;   /* cool off-white / instrument paper */
  --ground-2: #ECEFF4;   /* faint panel tint */
  --line:     #D7DDE6;   /* hairlines */
  --text:     #15191F;   /* ink */
  --muted:    #586173;   /* secondary text */
  --cool:     #2A4FC4;   /* blue end of coolwarm — compression */
  --warm:     #C43A26;   /* red end of coolwarm — expansion / heat */
  --cool-soft:#E4EAFB;
  --warm-soft:#F8E6E2;
  --cat-comp: var(--warm);   /* compressible flows */
  --cat-num:  var(--cool);   /* numerical analysis */
  --cat-ml:   #2E9E63;       /* machine learning */
  --cat-hpc:  #E0A32E;       /* software / HPC */

  /* type */
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  /* scale / rhythm */
  --maxw: 1080px;
  --pad: clamp(20px, 5vw, 56px);
  --r: 12px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

a { color: var(--cool); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

img { max-width: 100%; display: block; }

/* ---------- layout primitives ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: linear-gradient(90deg, var(--cool), var(--warm));
  display: inline-block;
}

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; }

/* ---------- top nav (tabs) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
#navflow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}
.nav-inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.brand {
  font-family: var(--display);
  font-weight: 400;
  font-size: 17.5px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 0 5px var(--ground), 0 0 5px var(--ground);
}
.brand b { font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, var(--warm), var(--cool) 78%);
  box-shadow: 0 0 0 3px var(--ground), 0 0 0 4px var(--line);
}
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a {
  font-size: 14.5px;
  color: var(--text);
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
  /* ground-colored halo keeps text legible over the navflow particles */
  text-shadow: 0 0 5px var(--ground), 0 0 5px var(--ground);
}
.tabs a:hover { color: var(--text); background: var(--ground-2); text-decoration: none; }
.tabs a[aria-current="page"] {
  color: var(--text);
  background: var(--cool-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cool) 28%, transparent);
}

/* mobile hamburger (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 34px;
  padding: 0 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav.open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 600px) {
  .nav-inner { flex-wrap: wrap; }
  .nav-toggle { display: flex; }
  .tabs {
    display: none;
    flex-basis: 100%;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }
  .nav.open .tabs { display: flex; }
  .tabs a { padding: 11px 12px; font-size: 15px; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
#flow {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.hero::after { /* legibility veil — fades the field toward text */
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(100deg, var(--ground) 8%, color-mix(in srgb, var(--ground) 55%, transparent) 52%, transparent 86%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(16px, 2.6vw, 28px) var(--pad) clamp(14px, 2.2vw, 24px);
}
.hero h1 {
  font-size: clamp(30px, 4.8vw, 50px);
  margin: 0 0 10px;
  max-width: 18ch;
}
.lede {
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.5;
  color: #2b313c;
  max-width: 42ch;
  margin: 0 0 14px;
}
.lede .hl { color: var(--warm); font-weight: 500; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px -10px rgba(20,30,60,.5); }
.btn.primary {
  background: var(--cool);
  border-color: var(--cool);
  color: #fff;
}
.btn.primary:hover { background: color-mix(in srgb, var(--cool) 88%, black); }

/* ---------- sections ---------- */
.section { padding: clamp(48px, 8vw, 88px) 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }
main > section:first-of-type { padding-top: clamp(14px, 2vw, 22px); }
.section h2 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 8px; }
.section .sub { color: var(--muted); margin: 0 0 36px; max-width: 56ch; }

.lead-text { font-size: 18px; max-width: 62ch; }
.lead-text p { margin: 0 0 18px; }

.standfirst {
  font-size: clamp(15px, 1.6vw, 16.5px);
  line-height: 1.55;
  color: #2b313c;
  max-width: 58ch;
  margin: 0 0 22px;
}
.standfirst .hl { color: var(--warm); font-weight: 500; }

.video-embed {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  margin: 28px 0 4px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b1220;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-embed[role="button"] { cursor: pointer; }
.yt-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.yt-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(120deg, var(--cool), var(--warm));
  box-shadow: 0 8px 22px -8px rgba(20, 30, 60, .65);
  display: grid; place-items: center;
  transition: transform .15s ease;
}
.yt-play::before {
  content: ""; width: 0; height: 0; margin-left: 4px;
  border-left: 17px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}
.video-embed:hover .yt-play,
.video-embed:focus-visible .yt-play { transform: translate(-50%, -50%) scale(1.07); }
.video-figure { max-width: 340px; margin: 26px 0 0; }
.video-figure .eyebrow { margin-bottom: 12px; }
.video-figure .video-embed { margin: 0; }
.video-cap {
  margin: 12px 0 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.video-cap .vtitle { font-family: var(--body); font-style: italic; font-size: 13.5px; color: var(--text); }
.video-cap a { font-family: var(--mono); font-size: 11.5px; color: var(--cool); }

/* ---------- rotating quote box ---------- */
.quote-wrap { margin-top: clamp(34px, 5vw, 56px); }
.quote-host { padding-bottom: clamp(30px, 4vw, 48px); }
.quote-box {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 6px clamp(12px, 4vw, 28px);
  transition: opacity .28s ease, filter .28s ease, transform .28s ease;
}
.quote-box.q-swap {
  opacity: 0;
  filter: blur(7px);
  transform: translateY(9px) scale(.985);
}
@media (prefers-reduced-motion: reduce) {
  .quote-box { transition: none; }
}
.flourish { display: block; width: min(210px, 58%); height: auto; margin: 0 auto 12px; }
.flourish.flip { transform: scaleY(-1); margin: 14px auto 0; }
.quote-hint {
  margin: 0 0 6px;
  text-align: right;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  opacity: .85;
}
.qlink {
  font: inherit;
  color: var(--cool);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.qlink:hover { color: color-mix(in srgb, var(--cool) 82%, black); }
.quote-box #quote-fa {
  font-family: "Kohinoor Telugu", "Telugu Sangam MN", "Nirmala UI", "Noto Sans Telugu", "Noto Naskh Arabic", var(--body), sans-serif;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 14px;
  white-space: pre-line;
}
.quote-box blockquote {
  font-family: var(--body);
  font-style: italic;
  font-size: clamp(16px, 1.9vw, 19px);
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  white-space: pre-line;
}
.quote-box figcaption {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.quote-box figcaption::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--cool), var(--warm));
}
.quote-box figcaption.no-dash::before { display: none; }

/* research-interest chips */
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 8px; }
.chip {
  font-family: var(--mono);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ground-2);
  border: 1px solid var(--line);
  color: #3a4252;
}

/* generic card grid */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 24px;
  position: relative;
}
.card .idx {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--cool);
  letter-spacing: 0.08em;
}
.card h3 { font-size: 20px; margin: 10px 0 10px; }
.card p { margin: 0; color: #38404e; font-size: 15.5px; line-height: 1.55; }
.card .topline { height: 3px; border-radius: 3px 3px 0 0; position: absolute; top: 0; left: 0; right: 0;
  background: linear-gradient(90deg, var(--cool), var(--warm)); opacity: .85; }

/* featured project cards */
.proj { display: flex; flex-direction: column; gap: 12px; }
.proj .tag {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em;
  color: var(--warm);
}
.proj .links { display: flex; gap: 14px; font-family: var(--mono); font-size: 13px; margin-top: auto; }

/* ---------- metrics ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 40px;
}
.metric { background: #fff; padding: 24px 22px; }
.metric .n { font-family: var(--display); font-size: 40px; font-weight: 600; line-height: 1;
  background: linear-gradient(135deg, var(--cool), var(--warm)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.metric .l { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); margin-top: 10px; }

/* compact citation line under the journal list */
.pub-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin: 0 0 6px;
}
.pub-head h3 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 0; padding: 0; border: 0;
}
.metrics-mini {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  text-align: right;
}
.metrics-mini b { color: var(--text); font-weight: 600; }
.metrics-mini a { color: var(--cool); white-space: nowrap; }

/* ---------- publications ---------- */
.wrap.pubs { max-width: 920px; }
.pub-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 26px 6px;
  box-shadow: 0 1px 3px rgba(20, 30, 60, .05);
  margin-bottom: 18px;
}
.pub-group > h3 {
  font-family: var(--display); font-size: 14px; font-weight: 600;
  letter-spacing: .04em; color: var(--muted);
  border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 0 0 6px;
}
.pub {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.pub:last-child { border-bottom: 0; }
.pub .year { font-family: var(--mono); font-size: 14px; color: var(--cool); }
.pub .title { font-family: var(--display); font-size: 17.5px; font-weight: 500; line-height: 1.3; margin: 0 0 6px; }
.pub .title a { color: var(--text); }
.pub .authors { font-size: 14.5px; color: var(--muted); margin: 0 0 6px; }
.pub .authors .me { color: var(--text); font-weight: 600; }
.pub .eqc { font-size: 13px; color: #6a7280; margin: 0 0 6px; }
.pub .meta { font-family: var(--mono); font-size: 12.5px; color: #6a7280; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.arxiv-pdf { display: inline-flex; align-items: center; color: #C8322A; }
.arxiv-pdf:hover { opacity: .7; }
.arxiv-pdf svg { width: 16px; height: 16px; display: block; }
.pub .venue { font-style: italic; font-family: var(--body); color: #404856; }
.pub .cites { color: var(--warm); }

/* category accent bar (left edge) + color key */
.pub::before {
  content: "";
  position: absolute;
  left: -14px; top: 18px; bottom: 18px;
  width: 4px; border-radius: 4px;
  background: var(--bar, transparent);
}
.bar-c  { --bar: var(--cat-comp); }
.bar-n  { --bar: var(--cat-num); }
.bar-m  { --bar: var(--cat-ml); }
.bar-nc { --bar: linear-gradient(var(--cat-num) 0 50%, var(--cat-comp) 50% 100%); }
.bar-cs { --bar: linear-gradient(var(--cat-comp) 0 50%, var(--cat-hpc) 50% 100%); }
.bar-mc { --bar: linear-gradient(var(--cat-comp) 0 50%, var(--cat-ml) 50% 100%); }
.bar-mn { --bar: linear-gradient(var(--cat-num) 0 50%, var(--cat-ml) 50% 100%); }
.bar-ms { --bar: linear-gradient(var(--cat-ml) 0 50%, var(--cat-hpc) 50% 100%); }
.pub-key {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin: 0 0 18px; font-size: 13px; color: var(--muted);
}
.pub-key span { display: inline-flex; align-items: center; gap: 7px; }
.pub-key .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-c { background: var(--cat-comp); }
.dot-n { background: var(--cat-num); }
.dot-m { background: var(--cat-ml); }
.dot-s { background: var(--cat-hpc); }

.talk { padding: 14px 0; border-bottom: 1px solid var(--line); }
.talk:last-child { border-bottom: 0; }
.talk .t { font-weight: 500; font-family: var(--display); }
.talk .d { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* ---------- gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.tile {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: #fff;
}
.tile canvas, .tile img { width: 100%; height: 230px; object-fit: cover; display: block; background: #0b1220; }
.tile .cap { padding: 14px 16px; }
.tile .cap .k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; color: var(--warm); }
.tile .cap .t { font-family: var(--display); font-weight: 500; font-size: 16px; margin: 4px 0 4px; }
.tile .cap .d { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.45; }

.note {
  font-size: 14.5px; color: var(--muted);
  background: var(--ground-2); border: 1px dashed var(--line);
  border-radius: var(--r); padding: 16px 18px; margin-top: 28px;
}
.note code { font-family: var(--mono); font-size: 13px; color: var(--cool); }

/* ---------- misc page ---------- */
.wrap.misc { max-width: 920px; }
.misc-toc { margin: 4px 0 28px; }
.misc-toc .toc-title {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.misc-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.misc-toc li { counter-increment: toc; padding: 7px 0; }
.misc-toc li::before {
  content: counter(toc) ". ";
  font-family: var(--mono); font-size: 14.5px; color: var(--muted); margin-right: 4px;
}
.misc-toc a { font-family: var(--display); font-size: 16px; color: var(--cool); text-decoration: underline; text-underline-offset: 3px; }
.misc-toc a:hover { color: color-mix(in srgb, var(--cool) 82%, black); }
.misc-group {
  scroll-margin-top: 84px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 26px 6px;
  box-shadow: 0 1px 3px rgba(20, 30, 60, .05);
  margin-bottom: 18px;
}
.misc-group > h3 {
  font-family: var(--display); font-size: 14px; font-weight: 600;
  letter-spacing: .04em; color: var(--muted);
  border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 0 0 6px;
}
#poetry { position: relative; padding-left: 66px; }
#poetry > h3 { position: relative; z-index: 1; }
.poem-bg {
  position: absolute; inset: 0; z-index: 0; border-radius: inherit;
  transition: opacity .5s ease;
  background-position: 14px 20px, 14px 20px, 48px 0, 0 0;
  background-repeat: repeat-y, repeat-y, repeat-y, repeat;
  background-size: 34px 30px, 34px 30px, 1px 9px, 170px 170px;
}
.poem-bg.theme-still {
  background-color: #F3F9F5;
  background-image:
    radial-gradient(circle 5px, var(--ground) 5px, transparent 5.3px),
    radial-gradient(circle 7px, #C3CFC8 7px, transparent 7.2px),
    repeating-linear-gradient(to bottom, #CBD5CE 0, #CBD5CE 2px, transparent 2px, transparent 9px),
    url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyMDAnIGhlaWdodD0nMjAwJyB2aWV3Qm94PScwIDAgMjAwIDIwMCc+CiAgPGcgZmlsbD0nbm9uZScgc3Ryb2tlPScjMkU5RTYzJyBzdHJva2Utb3BhY2l0eT0nMC4xNicgc3Ryb2tlLXdpZHRoPScxLjYnIHN0cm9rZS1saW5lY2FwPSdyb3VuZCc+CiAgICA8cGF0aCBkPSdNMzUgMTkwIEM1MCAxNTUgNDYgMTI1IDYwIDk4IEM3MCA3OCA2NiA1NSA4MCAzMicvPgogICAgPHBhdGggZD0nTTU4IDE0OCBDNDUgMTQzIDM1IDE0OCAyNiAxNjInLz4KICAgIDxwYXRoIGQ9J001OCAxNDggQzcyIDE0NiA4MiAxNTMgODYgMTY3Jy8+CiAgICA8cGF0aCBkPSdNNzIgMTAwIEM2MCA5OCA1MCAxMDQgNDQgMTE2Jy8+CiAgICA8cGF0aCBkPSdNNzIgMTAwIEM4MyAxMDAgOTAgMTA3IDkyIDEyMCcvPgogIDwvZz4KICA8ZyBmaWxsPScjMkU5RTYzJyBmaWxsLW9wYWNpdHk9JzAuMTMnIHN0cm9rZT0nbm9uZSc+CiAgICA8Y2lyY2xlIGN4PSc4MCcgY3k9JzMyJyByPSczLjQnLz4KICAgIDxlbGxpcHNlIGN4PSc3MScgY3k9JzI0JyByeD0nNS40JyByeT0nOScgdHJhbnNmb3JtPSdyb3RhdGUoLTMwIDcxIDI0KScvPgogICAgPGVsbGlwc2UgY3g9Jzg5JyBjeT0nMjQnIHJ4PSc1LjQnIHJ5PSc5JyB0cmFuc2Zvcm09J3JvdGF0ZSgzMCA4OSAyNCknLz4KICAgIDxlbGxpcHNlIGN4PSc4MCcgY3k9JzE4JyByeD0nNS40JyByeT0nOScvPgogICAgPGVsbGlwc2UgY3g9JzY2JyBjeT0nMzYnIHJ4PSc1LjQnIHJ5PSc5JyB0cmFuc2Zvcm09J3JvdGF0ZSgtNjIgNjYgMzYpJy8+CiAgICA8ZWxsaXBzZSBjeD0nOTQnIGN5PSczNicgcng9JzUuNCcgcnk9JzknIHRyYW5zZm9ybT0ncm90YXRlKDYyIDk0IDM2KScvPgogIDwvZz4KICA8ZyBmaWxsPSdub25lJyBzdHJva2U9JyMyRTlFNjMnIHN0cm9rZS1vcGFjaXR5PScwLjEwJyBzdHJva2Utd2lkdGg9JzEuMycgc3Ryb2tlLWxpbmVjYXA9J3JvdW5kJz4KICAgIDxwYXRoIGQ9J00xNTAgNjAgQzE2MCA0MCAxNTggMjIgMTcyIDgnLz4KICAgIDxwYXRoIGQ9J00xNjIgMzQgQzE1MiAzMCAxNDQgMzQgMTM4IDQ0Jy8+CiAgPC9nPgogIDxnIGZpbGw9JyMyRTlFNjMnIGZpbGwtb3BhY2l0eT0nMC4wOScgc3Ryb2tlPSdub25lJz4KICAgIDxjaXJjbGUgY3g9JzE3MicgY3k9JzgnIHI9JzIuNicvPgogICAgPGVsbGlwc2UgY3g9JzE2NScgY3k9JzMnIHJ4PSc0JyByeT0nNi41JyB0cmFuc2Zvcm09J3JvdGF0ZSgtMzAgMTY1IDMpJy8+CiAgICA8ZWxsaXBzZSBjeD0nMTc5JyBjeT0nMycgcng9JzQnIHJ5PSc2LjUnIHRyYW5zZm9ybT0ncm90YXRlKDMwIDE3OSAzKScvPgogIDwvZz4KPC9zdmc+");
}
.poem-bg.theme-frost {
  background-color: #EEF3F8;
  background-image:
    radial-gradient(circle 5px, var(--ground) 5px, transparent 5.3px),
    radial-gradient(circle 7px, #C3CFC8 7px, transparent 7.2px),
    repeating-linear-gradient(to bottom, #CBD5CE 0, #CBD5CE 2px, transparent 2px, transparent 9px),
    url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyMDAnIGhlaWdodD0nMjAwJyB2aWV3Qm94PScwIDAgMjAwIDIwMCc+CiAgPGcgZmlsbD0nbm9uZScgc3Ryb2tlPScjNUM3QTk5JyBzdHJva2Utb3BhY2l0eT0nMC4xNicgc3Ryb2tlLXdpZHRoPScxLjYnIHN0cm9rZS1saW5lY2FwPSdyb3VuZCc+CiAgICA8cGF0aCBkPSdNMzAgMTIgQzM0IDI4IDI5IDQwIDM1IDU1Jy8+CiAgICA8cGF0aCBkPSdNMzIgMjYgQzI1IDIzIDE3IDI2IDExIDM0Jy8+CiAgICA8cGF0aCBkPSdNMzIgMjYgQzM5IDI1IDQ2IDMwIDQ5IDM4Jy8+CiAgICA8cGF0aCBkPSdNMTUwIDEzOCBDMTU0IDE1MyAxNDkgMTY1IDE1NSAxODAnLz4KICAgIDxwYXRoIGQ9J00xNTIgMTUxIEMxNDUgMTQ4IDEzNyAxNTEgMTMxIDE1OScvPgogICAgPHBhdGggZD0nTTE1MiAxNTEgQzE1OSAxNTAgMTY2IDE1NSAxNjkgMTYzJy8+CiAgPC9nPgogIDxnIGZpbGw9JyM1QzdBOTknIGZpbGwtb3BhY2l0eT0nMC4xNycgc3Ryb2tlPSdub25lJz4KICAgIDxjaXJjbGUgY3g9JzcyJyBjeT0nNDgnIHI9JzIuNScvPgogICAgPGNpcmNsZSBjeD0nMTEyJyBjeT0nODgnIHI9JzEuOCcvPgogICAgPGNpcmNsZSBjeD0nMTYyJyBjeT0nMzgnIHI9JzIuMScvPgogICAgPGNpcmNsZSBjeD0nMjAnIGN5PScxMDgnIHI9JzEuNycvPgogICAgPGNpcmNsZSBjeD0nOTYnIGN5PScxNTAnIHI9JzIuNicvPgogICAgPGNpcmNsZSBjeD0nMTc2JyBjeT0nMTE4JyByPScxLjknLz4KICAgIDxjaXJjbGUgY3g9JzUwJyBjeT0nMTcwJyByPScxLjcnLz4KICAgIDxjaXJjbGUgY3g9JzEzMCcgY3k9JzE4JyByPScxLjUnLz4KICAgIDxjaXJjbGUgY3g9JzgnIGN5PSc2MCcgcj0nMS42Jy8+CiAgICA8Y2lyY2xlIGN4PScxOTAnIGN5PScxNjAnIHI9JzEuNicvPgogIDwvZz4KPC9zdmc+");
}
.poem-title {
  text-align: center;
  font-family: var(--display); font-size: 16px; font-weight: 500; color: var(--text);
  margin: 0; padding: 10px 0;
}
.poem { margin: 6px 0 4px; text-align: center; }
.poem p { font-family: var(--display); font-size: 16px; line-height: 1.6; color: #2b313c; margin: 0 0 18px; }
.poem p:last-child { margin-bottom: 0; }
.poem-by { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin: 10px 0 14px; text-align: center; }

.poem-pager { position: relative; z-index: 1; }
.poem-stage { position: relative; }
.poem-page { padding: 4px 10px; box-sizing: border-box; }
.poem-page p { transition: opacity .5s ease; }
.poem-nav {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 2px;
}
.poem-prev, .poem-next {
  width: 24px; height: 24px; border: 0; background: transparent; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  font-family: var(--display); font-size: 18px; line-height: 1; color: #8B95A3;
}
.poem-prev:hover, .poem-next:hover { color: var(--text); background: rgba(20, 30, 60, .06); }
.poem-prev:focus-visible, .poem-next:focus-visible { outline: 2px solid var(--cool); outline-offset: 1px; }
.poem-dots { display: flex; justify-content: center; gap: 7px; margin: 2px 0 4px; }
.poem-dots .dot {
  width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%;
  background: #C7D3CC; cursor: pointer;
}
.poem-dots .dot.active { background: #5F8870; }

.misc-list { margin: 0; padding: 0; list-style: none; }
.misc-list li { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: #38404e; }
.misc-list li:last-child { border-bottom: 0; }

#reading-list .misc-list { columns: 2; column-gap: 36px; }
#reading-list .misc-list li { break-inside: avoid; padding: 7px 0; border-bottom: none; }
@media (max-width: 620px) {
  #reading-list .misc-list { columns: 1; }
}

.book-table { width: 100%; border-collapse: collapse; margin: 4px 0 10px; }
.book-table th, .book-table td { text-align: left; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.book-table thead th { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.book-table td.topic { font-weight: 600; width: 220px; color: var(--text); font-size: 15px; }
.book-table td.books { color: #38404e; font-size: 15px; }
.book-table td.books ul { margin: 0; padding-left: 18px; }
.book-table td.books li { margin-bottom: 6px; }
.book-table td.books li:last-child { margin-bottom: 0; }
.book-table tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 620px) {
  .book-table thead { display: none; }
  .book-table, .book-table tbody, .book-table tr, .book-table td { display: block; width: auto; }
  .book-table td { padding: 4px 0; border-bottom: none; }
  .book-table td.topic {
    font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); font-weight: 500; padding-top: 14px;
  }
  .book-table tr { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .book-table tbody tr:last-child { border-bottom: none; }
}

/* ---------- footer ---------- */
.footer { padding: 40px 0 56px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.social { display: flex; gap: 8px; }
.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 50%; background: #fff;
  transition: color .12s ease, border-color .12s ease, transform .12s ease;
}
.social a:hover { color: var(--text); border-color: var(--cool); text-decoration: none; transform: translateY(-1px); }
.social svg { width: 17px; height: 17px; display: block; }
.foot-note { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- profile / CV timeline ---------- */
.cv-list { margin-top: 6px; }
.cv-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.cv-item:last-child { border-bottom: 0; }
.cv-item .when { font-family: var(--mono); font-size: 13px; color: var(--cool); padding-top: 3px; }
.cv-item .role { font-family: var(--display); font-weight: 600; font-size: 19px; margin: 0 0 3px; line-height: 1.2; }
.cv-item .org { color: var(--muted); font-size: 15px; margin: 0 0 10px; }
.cv-item .desc { margin: 0; font-size: 15px; color: #38404e; line-height: 1.55; }
.cv-item .note-inline { font-family: var(--mono); font-size: 12.5px; color: var(--warm); margin-left: 8px; }
@media (max-width: 680px) { .cv-item { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- CV: card layout (al-folio style) ---------- */
.cv { max-width: 920px; }
.cv-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 26px 8px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(20, 30, 60, .05);
}
.cv-card > h3 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  margin: 4px 0 2px;
}
.cv-row {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.cv-row::after { content: ""; display: table; clear: both; }
.cv-row:first-of-type { border-top: 0; }
.cv-aside { float: right; text-align: right; margin: 3px 0 4px 16px; }
.cv-badge {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--muted);
  line-height: 1.3;
}
.cv-inst { display: block; font-size: 16px; margin-top: 4px; opacity: .55; text-align: right; }
.edu-row {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 16px;
  align-items: start;
}
.edu-row .cv-aside { float: none; text-align: left; margin: 0; padding-top: 2px; }
.cv-logo {
  align-self: center;
  justify-self: end;
  height: 52px; width: auto; max-width: 120px;
  object-fit: contain;
}
.cv-logo[src*="iitm"], .cv-logo[src*="bits"] { height: 60px; max-width: 132px; }
/* wordmark logo shown in place of an institution name */
.id-logo-wrap { margin-top: 18px; }
.id-logo { display: inline-block; height: 40px; width: auto; max-width: 100%; }
.cv-body .title { font-family: var(--display); font-weight: 600; font-size: 17px; margin: 0 0 2px; }
.cv-body .title .note-inline { color: var(--warm); }
.cv-body .host { color: var(--muted); font-size: 14.5px; margin: 0 0 5px; line-height: 1.4; }
.cv-body .host b { color: #2b313c; font-weight: 600; }
.cv-body ul { margin: 0; padding-left: 18px; }
.cv-body li { font-size: 14.5px; color: #38404e; line-height: 1.45; margin-bottom: 2px; }
.cv-table { width: 100%; border-collapse: collapse; margin: 8px 0 10px; }
.cv-table td { padding: 6px 0; vertical-align: top; font-size: 15px; }
.cv-table td.k { font-weight: 600; width: 150px; color: var(--text); padding-right: 16px; }
.cv-table td.v { color: #38404e; }
.cv-card .intro { color: var(--muted); font-size: 14.5px; margin: 6px 0 4px; }
.cv-journals { margin: 6px 0 8px; padding-left: 18px; columns: 2; column-gap: 32px; }
.cv-journals li { font-size: 14.5px; color: #38404e; margin-bottom: 3px; break-inside: avoid; }
@media (max-width: 620px) {
  .cv-row .cv-aside { float: none; text-align: left; margin: 0 0 4px; }
  .cv-inst { text-align: left; }
  .cv-badge { display: inline-block; }
  .cv-journals { columns: 1; }
  .pub-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .metrics-mini { text-align: left; }
  /* keep education logos on the right, centered against the text block */
  .edu-row {
    grid-template-columns: 1fr auto;
    column-gap: 16px;
    align-items: center;
  }
  .edu-row .cv-aside { grid-column: 1; grid-row: 1; }
  .edu-row .cv-body  { grid-column: 1; grid-row: 2; margin-bottom: 0; }
  .edu-row .cv-logo  {
    grid-column: 2; grid-row: 1 / span 2;
    align-self: center; justify-self: end;
    height: 44px; max-width: 88px;
  }
  .edu-row .cv-logo[src*="iitm"], .edu-row .cv-logo[src*="bits"] { height: 50px; max-width: 96px; }
  .id-logo { height: 34px; }
}

/* split layout for about: text + side panel */
.split { display: grid; grid-template-columns: 320px 1fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.split .panel { order: -1; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.panel h3 { font-size: 15px; font-family: var(--display); margin: 0 0 14px; letter-spacing: .02em; }
.panel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; font-size: 14.5px; }
.panel dt { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.panel dd { margin: 0; color: #2b313c; }

.panel-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 85%;
  border-radius: 10px;
  display: block;
  margin: 0 0 16px;
}
.panel-id { text-align: center; }
.id-name {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 6px 0 14px;
}
.id-name b { font-weight: 700; }
.id-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.id-list li { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 14.5px; color: #38404e; }
.id-list .ic { width: 15px; height: 15px; flex: none; color: var(--muted); }
.id-lab {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: #38404e;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.id-lab .lab-k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 3px;
}
.id-lab a { color: var(--cool); }

.portrait {
  aspect-ratio: 4/5; border-radius: var(--r); overflow: hidden;
  background:
    radial-gradient(120% 120% at 30% 20%, var(--warm-soft), transparent 55%),
    radial-gradient(120% 120% at 80% 90%, var(--cool-soft), transparent 55%),
    var(--ground-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted); text-align: center; padding: 20px;
}
