/* ---------------------------------------------------------------
   sreeja-apparaju.github.io
   Plain HTML + CSS. No build step, no framework, no CDN.
   Design tokens are the first block — edit there to restyle.
   --------------------------------------------------------------- */

/* ---------- Computer Modern (the LaTeX serif), served locally ---------- */

@font-face {
  font-family: "Computer Modern Serif";
  src: url("../fonts/cmunrm.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Computer Modern Serif";
  src: url("../fonts/cmunbx.woff2") format("woff2");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Computer Modern Serif";
  src: url("../fonts/cmunti.woff2") format("woff2");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  color-scheme: light;

  --gap: 24px;
  --main-width: 720px;
  --footer-height: 70px;
  --radius: 3px;

  --theme: #f1f5f4;
  --primary: #1b2221;
  --secondary: #62706e;
  --tertiary: #dde7e4;
  --content: #1b2221;
  --border: #dde5e3;
  --code-bg: #e6eeec;
  --accent: #3f6f72;
  --accent-hover: #5aa9ad;
  --shade: rgba(0, 0, 0, 0.06);

  --serif: "Computer Modern Serif", Georgia, "Times New Roman", serif;
  --homesize: 16px;
  --lineheight: 1.45;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --theme: #161b1c;
    --primary: #dde3e2;
    --secondary: #8f9c9a;
    --tertiary: #2b3536;
    --content: #c2cbca;
    --border: #2a3334;
    --code-bg: #222b2c;
    --accent: #5aa9ad;
    --accent-hover: #7cc6c9;
    --shade: rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --theme: #161b1c;
  --primary: #dde3e2;
  --secondary: #8f9c9a;
  --tertiary: #2b3536;
  --content: #c2cbca;
  --border: #2a3334;
  --code-bg: #222b2c;
  --accent: #5aa9ad;
  --accent-hover: #7cc6c9;
  --shade: rgba(0, 0, 0, 0.3);
}

/* ---------- base ---------- */

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

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  word-break: break-word;
  color: var(--content);
  background: var(--theme);
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

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

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

h1,
h2,
h3 {
  color: var(--primary);
  margin: 0;
  font-weight: bold;
  text-wrap: balance;
}

/* ---------- page shell ---------- */

.main {
  position: relative;
  max-width: calc(var(--main-width) + var(--gap) * 2);
  margin: auto;
  padding: var(--gap);
}

/* ---------- profile (matches amks.me: left-aligned, vertically centred) ---------- */

.profile {
  display: flex;
  justify-content: left;
  align-items: center;
  min-height: calc(100vh - var(--footer-height) - (var(--gap) * 2));
  font-size: var(--homesize);
  line-height: var(--lineheight);
}

.profile .profile_inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.profile img.portrait {
  width: 102px;
  height: 102px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}

.profile .profile_inner h1 {
  font-size: 40px;
  line-height: 1.2;
}

.subtitle p {
  margin: 0 0 14px;
}

.subtitle p:last-child {
  margin-bottom: 0;
}

/* ---------- social icons ---------- */

.social-icons {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 0 -10px;
  padding: 0;
  list-style: none;
}

.social-icons a {
  display: inline-flex;
  padding: 10px;
  color: var(--primary);
}

.social-icons a:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.social-icons svg {
  height: 26px;
  width: 26px;
}

/* ---------- buttons ---------- */

.buttons {
  display: flex;
  justify-content: left;
  flex-wrap: wrap;
}

.button {
  background: var(--tertiary);
  border-radius: var(--radius);
  margin: 8px 16px 8px 0;
  padding: 6px;
  color: var(--primary);
  transition: background-color 0.2s ease-in-out;
}

.button:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--tertiary));
  color: var(--primary);
  text-decoration: none;
}

.button-inner {
  padding: 0 8px;
}

/* ---------- publications ---------- */

.section {
  padding-block: 8px 48px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.section-head h2 {
  font-size: 25px;
}

.count {
  font-size: 14px;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

/* The scroll box. Change --pub-height to show more or fewer at once. */
.pubs-scroll {
  --pub-height: 22rem;

  max-height: var(--pub-height);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 16px 4px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--tertiary) transparent;
  /* Scroll shadows: the `local` covers scroll away with the content and reveal
     the `scroll` shadows underneath, so the hint shows only when it overflows. */
  background:
    linear-gradient(var(--theme) 30%, transparent) top / 100% 36px no-repeat local,
    linear-gradient(transparent, var(--theme) 70%) bottom / 100% 36px no-repeat local,
    radial-gradient(farthest-side at 50% 0, var(--shade), transparent) top / 100% 12px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, var(--shade), transparent) bottom / 100% 12px no-repeat scroll;
}

.pubs-scroll::-webkit-scrollbar {
  width: 8px;
}

.pubs-scroll::-webkit-scrollbar-thumb {
  background: var(--tertiary);
  border-radius: 4px;
}

.pubs {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--homesize);
  line-height: var(--lineheight);
}

.pub {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0 16px;
  padding-block: 18px;
}

.pub + .pub {
  border-top: 1px solid var(--border);
}

.pub .year {
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  padding-top: 2px;
}

.pub h3 {
  font-size: var(--homesize);
  line-height: 1.4;
  margin-bottom: 2px;
}

.pub .authors {
  margin: 0;
  color: var(--secondary);
}

.pub .venue {
  margin: 2px 0 0;
  color: var(--secondary);
  font-style: italic;
}

.pub .me {
  color: var(--primary);
  font-weight: bold;
}

.pub .links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 6px 0 0;
  font-size: 14px;
}

/* ---------- notes list ---------- */

.notes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.notes li + li {
  border-top: 1px solid var(--border);
}

.notes a.note-link {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0 16px;
  padding-block: 18px;
  color: var(--content);
}

.notes a.note-link:hover {
  text-decoration: none;
}

.notes a.note-link:hover h3 {
  color: var(--accent-hover);
}

.notes .date {
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  padding-top: 3px;
}

.notes h3 {
  font-size: 19px;
}

.notes p {
  margin: 2px 0 0;
  color: var(--secondary);
  font-size: var(--homesize);
}

/* ---------- note page ---------- */

.backlink {
  display: inline-block;
  font-size: 14px;
  color: var(--secondary);
  padding-block: 8px;
}

.backlink:hover {
  color: var(--accent-hover);
}

.note-header {
  padding-block: 32px 8px;
}

.note-header h1 {
  font-size: 34px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.note-header .date {
  color: var(--secondary);
  font-size: 14px;
}

.page-intro {
  color: var(--secondary);
  margin: 6px 0 24px;
}

.prose {
  padding-bottom: 56px;
}

.prose h2 {
  font-size: 25px;
  margin-block: 36px 12px;
}

.prose p,
.prose ul,
.prose ol {
  margin-block: 0 18px;
}

.prose blockquote {
  margin: 24px 0;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
  color: var(--secondary);
  font-style: italic;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 0.1em 0.35em;
}

.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
}

.prose pre code {
  background: none;
  padding: 0;
}

.table-wrap {
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
}

.prose th,
.prose td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

/* ---------- footer ---------- */

.foot {
  max-width: calc(var(--main-width) + var(--gap) * 2);
  margin: auto;
  padding: 0 var(--gap) var(--gap);
  min-height: var(--footer-height);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  align-items: center;
  color: var(--secondary);
  font-size: 13px;
}

.foot a {
  color: var(--secondary);
}

.foot a:hover {
  color: var(--accent-hover);
}

/* ---------- theme toggle ---------- */

#theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--theme);
  color: var(--secondary);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

#theme-toggle:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

#theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* ---------- editor placeholders (delete before going live) ---------- */

.todo {
  background: var(--code-bg);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 0.05em 0.4em;
  font-size: 0.9em;
  color: var(--accent);
  font-style: normal;
}

/* ---------- narrow screens ---------- */

@media (max-width: 560px) {
  .profile .profile_inner h1 {
    font-size: 32px;
  }

  .pub,
  .notes a.note-link {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .pub .year,
  .notes .date {
    padding-top: 0;
  }

  .pubs-scroll {
    --pub-height: 24rem;
    padding-right: 8px;
  }
}
