/* ------------------------------------------------------------------
   Aditya Jambhale — site styles
   Colours are defined once here; change them and every page follows.
   ------------------------------------------------------------------ */

:root {
  /* Light mode. Gold is too pale to read as text on white, so text that takes
     the accent role uses a deep amber, and the gold itself is kept for lines,
     underlines and button fills. */
  --paper: #ffffff;
  --ink: #1b2a41;          /* main text: a blue-black ink */
  --muted: #5b6676;        /* secondary text */
  --accent: #e0a730;       /* the gold: line under the header, underlines */
  --accent-ink: #8a5a00;   /* links and other accent-coloured text */
  --accent-strong: #5f3e00;/* links on hover */
  --accent-fill: #f3c14f;  /* button backgrounds */
  --accent-fill-hover: #e6ad2e;
  --on-accent: #1b2a41;    /* text on a gold button */
  --rule: #dde3e8;
  --wash: #f3f5f7;
  --error: #b3261e;

  --serif: "STIX Two Text", "STIX Two", Cambria, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 38rem;      /* comfortable reading width */
  --page: 54rem;         /* overall page width */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode: gold chalk on a deep blue-slate board. */
    --paper: #161d29;
    --ink: #ece8df;          /* warm off-white */
    --muted: #9ea8b6;
    --accent: #f3c14f;
    --accent-ink: #f3c14f;
    --accent-strong: #ffd98a;
    --accent-fill: #f3c14f;
    --accent-fill-hover: #ffd270;
    --on-accent: #161d29;
    --rule: #2a3445;
    --wash: #1e2634;
    --error: #ff9f94;
  }
}

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

html {
  font-size: clamp(17px, 15.5px + 0.35vw, 19px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.62;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent-ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
}
a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }

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

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 40rem) { .wrap { padding: 0 2rem; } }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--paper);
  padding: 0.4rem 0.8rem;
  z-index: 10;
}
.skip-link:focus { left: 1rem; }

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

.site-header { padding-top: 2.25rem; }

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

.site-name {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.005em;
}
.site-name a { color: inherit; text-decoration: none; }

.site-affiliation {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.02rem;
  padding: 0.15rem 0;
}
.site-nav a:hover { color: var(--accent-ink); }
.site-nav a[aria-current="page"] {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

/* The line under the header: a sample path of reflected Brownian motion */
.trace {
  width: 100%;
  height: 34px;
  margin-top: 1.1rem;
}
.trace--draw { animation: reveal 1.8s cubic-bezier(.3,.6,.2,1) both; }
@keyframes reveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  .trace--draw { animation: none; }
}

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

main { padding: 2.5rem 0 4rem; }

h1, h2, h3 { font-weight: 600; line-height: 1.25; }

.page-title {
  font-size: 2rem;
  font-weight: 500;
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 0.75rem;
}

p { margin: 0 0 1rem; }

.prose { max-width: var(--measure); }
.lede { font-size: 1.08rem; }

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

.intro {
  display: grid;
  gap: 2rem;
}
@media (min-width: 46rem) {
  .intro {
    grid-template-columns: 14.5rem minmax(0, 1fr);
    gap: 3.25rem;
    align-items: start;
  }
}

.portrait {
  margin: 0;
  max-width: 14.5rem;
}
.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 3px;
  background: var(--wash);
}

.bio h2:first-child { margin-top: 0; }

.contact {
  font-style: normal;
  margin-bottom: 1.25rem;
}

.profile-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
}

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

.papers {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 44rem;
}

.paper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem 1.5rem;
  padding: 1.1rem 0 1.4rem;
}
@media (min-width: 40rem) {
  .paper { grid-template-columns: 3.5rem minmax(0, 1fr); }
}

.paper-year {
  color: var(--muted);
  font-variant-numeric: lining-nums tabular-nums;
  padding-top: 0.08rem;
}

.paper-title {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
  line-height: 1.35;
}
.paper-title a { color: var(--ink); text-decoration: none; }
.paper-title a:hover { color: var(--accent-ink); text-decoration: underline; }

.paper-authors,
.paper-venue {
  margin: 0;
  color: var(--muted);
}
.paper-venue cite { font-style: italic; }

.paper-links {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.95rem;
}

.paper details { margin-top: 0.5rem; font-size: 0.97rem; }
.paper summary {
  cursor: pointer;
  color: var(--accent-ink);
  width: fit-content;
}
.paper details p {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  max-width: var(--measure);
}

/* ---------- Pages still being written ---------- */

.pending {
  max-width: var(--measure);
  color: var(--muted);
  font-style: italic;
}

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

.site-footer {
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
