:root {
  --paper: #F5EFE3;
  --ink: #2B2622;
  --muted: #756A5F;
  --rule: #E2D8C6;
  --link: #2F5D8C;
  --mark: #F3D98A;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1C1915;
    --ink: #E9E1D3;
    --muted: #A39684;
    --rule: #37312A;
    --link: #9CBFE3;
    --mark: #6B5720;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.65 Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
}
main { max-width: 38rem; margin: 0 auto; padding: 4.5rem 1.25rem 5rem; }
h1 { font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin: 0 0 1.25rem; }
h2 {
  font-size: 1.15rem; font-weight: 700; font-variant: small-caps; letter-spacing: 0.05em;
  text-transform: lowercase; color: var(--muted); margin: 3rem 0 0.75rem;
}
p { margin: 0 0 1rem; }
ul { margin: 0; padding-left: 1.2rem; }
li { margin: 0 0 0.55rem; }
li::marker { color: var(--muted); }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
mark { background: var(--mark); color: inherit; padding: 0 0.15em; border-radius: 2px; }

/* Timeline: year on the left, work on the right */
.timeline { margin: 0; }
.year {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 0 1rem;
  padding: 0.9rem 0; border-top: 1px solid var(--rule);
}
.year > span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.9rem; padding-top: 0.2rem; }
.item { margin: 0 0 0.9rem; }
.item:last-child { margin-bottom: 0; }
.item b { font-weight: 700; }
.item p { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
@media (max-width: 480px) {
  body { font-size: 17px; }
  main { padding-top: 3rem; }
  .year { grid-template-columns: 1fr; }
  .year > span { padding: 0 0 0.3rem; }
}

/* Project pages (for example sumo-maths.html). Use <main class="project">. */
.project .back { margin: 0 0 2.5rem; font-size: 0.95rem; }
.project .meta { color: var(--muted); font-size: 0.95rem; margin: -0.9rem 0 1.75rem; }
.project h3 { font-size: 1rem; font-weight: 700; margin: 1.75rem 0 0.4rem; }
.project ul { margin-bottom: 1rem; }
.project ul ul { margin: 0.55rem 0 0; }
.project img { display: block; max-width: 100%; height: auto; margin: 1.5rem 0; border-radius: 4px; }

/* Photos and videos on project pages */
.photo { display: block; width: 100%; height: auto; margin: 1.75rem 0; border-radius: 4px; background: var(--rule); }
figure { margin: 1.75rem 0; }
figure .photo { margin: 0; }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; }

/* Small preview photo under a project title on the home page */
.thumb { display: block; width: 11rem; max-width: 100%; height: auto; margin: 0.5rem 0 0.4rem; border-radius: 4px; background: var(--rule); }
