/* alexanderquispe.github.io — minimal academic layout (light + dark) */

:root {
  --bg: #fdfcf9;
  --fg: #1f1f1f;
  --muted: #6b6b6b;
  --rule: #e4e1da;
  --link: #1d4f91;
  --link-hover: #0f2f5c;
  --code-bg: #f4f2ed;
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --fg: #e7e4dd;
    --muted: #9c9a94;
    --rule: #2f3136;
    --link: #92b6f0;
    --link-hover: #c3d6f7;
    --code-bg: #212328;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

.container.wide {
  max-width: 1200px;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

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

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 0 32px;
  text-align: center;
}

.site-name {
  font-size: 36px;
  font-weight: 400;
  color: var(--fg);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
  font-size: 19px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--fg);
}

.site-footer {
  margin-top: 72px;
  padding: 24px 0 48px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 17px;
}

.site-footer a {
  color: var(--muted);
}

/* ---------- headings ---------- */

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

h2 {
  font-size: 28px;
  margin: 56px 0 14px;
}

h3 {
  font-size: 21px;
  font-weight: 600;
  margin: 28px 0 8px;
}

.muted {
  color: var(--muted);
}

/* ---------- intro ---------- */

.intro {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: center;
  max-width: 780px;
  margin: 0 auto;
}

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

.portrait {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
}

.contact {
  color: var(--muted);
}

/* ---------- three-column home ---------- */

.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
  margin-top: 64px;
  font-size: 17px;
  line-height: 1.45;
}

.col h2 {
  font-size: 19px;
  font-weight: 600;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  margin: 0 0 16px;
}

.col h2:not(:first-child) {
  margin-top: 40px;
}

.col h3 {
  font-size: 17px;
  font-weight: 600;
  font-style: italic;
  margin: 20px 0 8px;
}

.col p {
  margin: 0 0 10px;
}

.papers {
  margin: 0;
  padding-left: 1.5em;
}

.papers li {
  margin: 0 0 16px;
  padding-left: 2px;
}

.paper-title {
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
  text-decoration: none;
}

a.paper-title:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.meta {
  margin-top: 2px;
}

.links {
  white-space: nowrap;
}

.summary {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.items li {
  margin: 0 0 10px;
}

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

.news li {
  margin: 0 0 12px;
}

.news .date {
  display: block;
  color: var(--muted);
  font-size: 15.5px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 980px) {
  .columns {
    grid-template-columns: minmax(0, 1fr);
    max-width: 680px;
    margin: 8px auto 0;
    gap: 8px;
    font-size: 18px;
  }

  .col h2 {
    margin-top: 40px !important;
  }
}

/* ---------- blog ---------- */

.page-title {
  font-size: 36px;
  margin: 8px 0 6px;
}

.lede {
  color: var(--muted);
  margin: 0 0 32px;
}

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

.post-list li {
  margin: 0 0 26px;
}

.post-list time {
  display: block;
  color: var(--muted);
  font-size: 17px;
}

.post-link {
  font-size: 23px;
  font-weight: 500;
}

.post-list p {
  margin: 4px 0 0;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

.post-header h1 {
  font-size: 38px;
  margin: 8px 0 4px;
}

.post-meta {
  color: var(--muted);
  margin: 0 0 32px;
}

.post-body {
  font-size: 20.5px;
  line-height: 1.62;
}

.post-body img,
.post-body video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px auto 8px;
}

.post-body figure {
  margin: 28px 0;
}

.post-body figcaption {
  color: var(--muted);
  font-size: 17px;
  text-align: center;
}

.post-body blockquote {
  margin: 24px 0;
  padding: 0 0 0 18px;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}

.post-body code {
  font-family: var(--mono);
  font-size: 0.78em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

.post-body pre {
  background: var(--code-bg);
  padding: 14px 16px;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.45;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 15px;
}

.post-body table {
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 18px;
}

.post-body th,
.post-body td {
  border-bottom: 1px solid var(--rule);
  padding: 6px 12px;
  text-align: left;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

mjx-container[display="true"] {
  overflow-x: auto;
  overflow-y: hidden;
}

.post-back {
  margin-top: 48px;
}

.comments {
  margin-top: 40px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}

.comments h2 {
  margin-top: 24px;
}

/* ---------- teaching: student pages ---------- */

.back {
  margin: 0 0 4px;
  font-size: 16px;
}

.people-heading {
  margin: 40px 0 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.people {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 28px 18px;
}

.person {
  text-align: center;
  font-size: 16px;
  line-height: 1.3;
}

.avatar {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--code-bg);
  color: var(--muted);
  font-size: 30px;
  letter-spacing: 0.02em;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-name {
  font-weight: 500;
}

.person-role {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14.5px;
}

.person-links {
  margin-top: 4px;
  font-size: 14.5px;
}

/* ---------- syntax highlighting (rouge) ---------- */

.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs { color: var(--muted); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kc, .highlight .ow { color: #8a3ffc; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd, .highlight .sb { color: #1a7f37; }
.highlight .m, .highlight .mi, .highlight .mf { color: #b35900; }
.highlight .nf, .highlight .fm { color: #0550ae; }
.highlight .nb, .highlight .bp { color: #0a6b74; }

@media (prefers-color-scheme: dark) {
  .highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kc, .highlight .ow { color: #c4a2ff; }
  .highlight .s, .highlight .s1, .highlight .s2, .highlight .sd, .highlight .sb { color: #7ee2a8; }
  .highlight .m, .highlight .mi, .highlight .mf { color: #f5b971; }
  .highlight .nf, .highlight .fm { color: #8cc4ff; }
  .highlight .nb, .highlight .bp { color: #6fd6dd; }
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  body {
    font-size: 19px;
  }

  .site-header {
    padding: 24px 0 20px;
  }

  .site-name {
    font-size: 30px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .portrait {
    width: 160px;
    height: 160px;
    margin: 0 auto;
  }

  .post-header h1 {
    font-size: 31px;
  }
}
