/* ==========================================================================
   prernakundu.github.io
   Plain CSS, no build step. Colours and type live in :root.
   ========================================================================== */

:root {
  --bg: #fcfbf8;
  --surface: #f4f2ec;
  --ink: #1d1e20;
  --muted: #5c6066;
  --rule: #e2dfd7;
  --accent: #1f5f5b;
  --accent-hover: #164845;
  --accent-soft: #e3ecea;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

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

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

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

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 24px; padding-top: 22px; padding-bottom: 16px;
}
.site-name { font-size: 1.3rem; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; }
.site-name:hover { color: var(--ink); text-decoration: none; }

.site-nav { display: flex; gap: 22px; font-family: var(--sans); font-size: 0.92rem; }
.site-nav a { color: var(--muted); padding-bottom: 3px; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Main ---------- */

main { padding: 40px 0 56px; }

h1, h2, h3 { line-height: 1.25; margin: 0; }

.page-title { font-size: 1.7rem; font-weight: 600; margin-bottom: 0.4em; letter-spacing: -0.01em; }
.page-lede { color: var(--muted); margin: 0 0 1.5em; }

.section-label {
  font-family: var(--sans); font-size: 0.74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
  padding-bottom: 8px; border-bottom: 1px solid var(--rule);
  margin: 2.6em 0 1.4em;
}
.section-label:first-child { margin-top: 0; }

/* ---------- Home ---------- */

.intro { display: grid; grid-template-columns: 200px 1fr; gap: 36px; align-items: start; }
.intro-photo img { width: 200px; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.intro-text p { margin: 0 0 1em; }
.intro-text p:last-child { margin-bottom: 0; }

.icon-links {
  list-style: none; margin: 14px 0 0; padding: 0;
  display: flex; justify-content: space-between; width: 200px;
}
.icon-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 1px solid var(--rule); border-radius: 50%;
  color: var(--muted); transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-links a:hover {
  color: var(--accent); border-color: var(--accent); background: var(--accent-soft); text-decoration: none;
}
.icon-links svg { width: 16px; height: 16px; }

.aside {
  margin-top: 2.4em; padding: 14px 18px; background: var(--surface);
  border-radius: 6px; font-size: 0.95rem; color: var(--muted);
}
.aside a { font-weight: 600; }

/* ---------- Research ---------- */

.paper { margin-bottom: 1.9em; }
.paper:last-child { margin-bottom: 0; }

.paper-title { font-size: 1.08rem; font-weight: 600; line-height: 1.4; }
.paper-title a { color: var(--ink); }
.paper-title a:hover { color: var(--accent); }

.paper-authors { color: var(--muted); font-size: 0.96rem; margin-top: 2px; }
.paper-authors a { color: var(--muted); border-bottom: 1px solid var(--rule); }
.paper-authors a:hover { color: var(--accent); text-decoration: none; border-bottom-color: var(--accent); }

.paper-status { font-size: 0.96rem; margin-top: 2px; }

.paper-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
  font-family: var(--sans); font-size: 0.78rem;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border: 1px solid var(--rule); border-radius: 999px;
  background: transparent; color: var(--ink); font: inherit; line-height: 1.6;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn .chev { transition: transform 0.15s ease; font-size: 0.7em; }
.btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.btn-note { color: var(--muted); padding: 3px 2px; font-style: italic; }

.abstract {
  margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--accent-soft);
  font-size: 0.95rem; color: var(--ink);
}
.abstract p { margin: 0; }
.js .abstract { display: none; }
.js .abstract.is-open { display: block; }

.writing { list-style: none; margin: 0; padding: 0; }
.writing li { margin-bottom: 1.1em; }
.writing .meta { color: var(--muted); font-size: 0.95rem; }

/* ---------- Data ---------- */

.dataset-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.dataset-head .page-title { margin-bottom: 0; }
.dataset-summary { margin: 0.8em 0 0; font-size: 1.05rem; }
.tag {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  padding: 2px 8px; border-radius: 999px;
}

.stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 10px; margin: 1.6em 0 0.4em;
}
.stat {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: 12px 14px 11px; font-family: var(--sans);
}
.stat-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted);
}
.stat-value { font-size: 1.6rem; font-weight: 650; letter-spacing: -0.02em; margin: 2px 0; }
.stat-sub { font-size: 0.76rem; color: var(--muted); line-height: 1.4; }

.prose p { margin: 0 0 1em; }
.prose ul { margin: 0 0 1em; padding-left: 1.2em; }
.prose li { margin-bottom: 0.35em; }

/* ---------- CV ---------- */

.cv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cv-head .page-title { margin-bottom: 0; }
.cv-head .btn { font-family: var(--sans); font-size: 0.82rem; }
.cv-frame {
  display: block; width: 100%; height: 82vh; min-height: 520px;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--surface);
}

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); }
.site-footer .wrap {
  padding-top: 18px; padding-bottom: 28px;
  font-family: var(--sans); font-size: 0.78rem; color: var(--muted);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px;
}
.site-footer a { color: var(--muted); }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  body { font-size: 17px; }
  main { padding-top: 28px; }
  .intro { grid-template-columns: 1fr; gap: 20px; }
  .intro-photo img { width: 140px; }
}
