/* ============================================================
   Yash Maheshwari — Research
   Quiet, text-first academic page. No frameworks, no chrome.
   ============================================================ */

:root {
  --bg: #fcfcfa;
  --ink: #1b1b19;
  --muted: #63635d;
  --faint: #9a9a92;
  --rule: rgba(20, 20, 15, 0.11);
  --accent: #2b4ea0;
  --measure: 60rem;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 6rem) 1.5rem 5rem;
}

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

/* ---------- masthead ---------- */
.kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.masthead h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.lede {
  margin-top: 1rem;
  max-width: none;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4rem 0;
}

.section-label {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 2rem;
}

/* ---------- paper grid (2 x 2) ---------- */
.papers {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  column-gap: 3.4rem;
  row-gap: 0;
}
.paper {
  position: relative;
  padding: 2rem 0 2.4rem;
  border-top: 1px solid var(--rule);
}
@media (max-width: 720px) {
  .papers {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
}

.paper-index {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.paper-meta {
  margin: 0.15rem 0 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  text-transform: uppercase;
}
.paper-meta .sep {
  margin: 0 0.5rem;
  opacity: 0.6;
}

.paper-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.28;
  letter-spacing: -0.005em;
}
.paper-title a {
  color: var(--ink);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s ease, color 0.2s ease;
}
.paper-title a:hover {
  color: var(--accent);
  background-size: 100% 1px;
  text-decoration: none;
}

.paper-tldr {
  margin-top: 0.7rem;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* figure: modest, quiet, hairline framed */
.paper-fig {
  display: block;
  margin-top: 1.2rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #ffffff;
  overflow: hidden;
  line-height: 0;
}
.paper-fig img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  padding: 0.6rem;
}
.paper-fig.doc img {
  object-fit: cover;
  object-position: top center;
  max-height: 300px;
  padding: 0;
}

/* abstract disclosure */
.paper-more {
  margin-top: 1.1rem;
}
.disclose {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}
.disclose:hover .disclose-label {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.disclose .tri {
  display: inline-block;
  width: 0.9em;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.abstract-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}
.abstract-wrap.open {
  grid-template-rows: 1fr;
}
.abstract-inner {
  overflow: hidden;
}
.paper-abstract {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.72;
  text-wrap: pretty;
}

/* ---------- colophon ---------- */
.colophon {
  margin-top: 4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.85rem;
  display: flex;
  gap: 0.6rem;
}

/* ---------- one quiet page-load settle ---------- */
@media (prefers-reduced-motion: no-preference) {
  .paper,
  .masthead,
  .section-label {
    animation: settle 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .masthead {
    animation-delay: 0.02s;
  }
  .section-label {
    animation-delay: 0.08s;
  }
  /* staggered settle for the paper list (was an inline style; moved here so the
     Content-Security-Policy can forbid inline styles) */
  .paper:nth-child(1) {
    animation-delay: 0.12s;
  }
  .paper:nth-child(2) {
    animation-delay: 0.18s;
  }
  .paper:nth-child(3) {
    animation-delay: 0.24s;
  }
  .paper:nth-child(4) {
    animation-delay: 0.3s;
  }
  .paper:nth-child(5) {
    animation-delay: 0.36s;
  }
  .paper:nth-child(6) {
    animation-delay: 0.42s;
  }
  @keyframes settle {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .paper-title {
    font-size: 1.24rem;
  }
}
