/* programerror.com
   Hand-written. No build step, no dependencies, no web fonts.
   Palette: Shark Blue. Type: system stack, so it never breaks and never
   waits on a network request. */

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

:root {
  color-scheme: light;

  --paper:  #FBFCFD;
  --raise:  #F1F4F7;
  --ink:    #12171C;
  --muted:  #58646F;
  --rule:   #DFE4EA;
  --accent: #0B79A8;
  --accent-strong: #095F85;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  --measure: 43rem;
  --gap: 1.6rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --paper:  #0F1419;
    --raise:  #171E25;
    --ink:    #E8EDF2;
    --muted:  #8D97A3;
    --rule:   #232B34;
    --accent: #4FC3E8;
    --accent-strong: #7AD5F0;
  }
}

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

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

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

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--accent-strong); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }

/* ---------- layout ---------------------------------------------------- */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.4rem;
}

main { padding-bottom: 5rem; }

section + section { margin-top: 3.2rem; }

/* ---------- masthead -------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 3rem;
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.6rem;
  padding-block: 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}
.brand:hover { color: var(--ink); }
.brand:hover .brand-mark { color: var(--accent-strong); }
.brand-mark {
  width: 26px;
  height: 23px;
  color: var(--accent);
  flex: none;
  transition: color 0.15s ease;
}

.nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.15rem;
  font-size: 0.95rem;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
}
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- page head ------------------------------------------------- */

.page-head { margin-bottom: 2.6rem; }

.page-head h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.standfirst {
  margin: 0.9rem 0 0;
  font-size: 1.12rem;
  color: var(--muted);
}
.standfirst strong { color: var(--ink); font-weight: 500; }

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

h2.section {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.5rem;
}

/* ---------- entries (jobs, projects) ---------------------------------- */

.entries { display: flex; flex-direction: column; gap: var(--gap); }
.entry[id] { scroll-margin-top: 1.5rem; }

.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 1.5rem;
  align-items: baseline;
}

.entry-title {
  font-size: 1.03rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.entry-title a { text-decoration: none; }
.entry-title a:hover { text-decoration: underline; }

.entry-org {
  font-weight: 400;
  color: var(--muted);
}
.entry-org::before { content: " \00b7 "; }

.entry-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.entry-body {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0;
  color: var(--muted);
}
.entry-body p { margin: 0; }
.entry-body ul {
  margin: 0;
  padding-left: 1.1rem;
  list-style: none;
}
.entry-body li { position: relative; }
.entry-body li::before {
  content: "\2014";
  position: absolute;
  left: -1.1rem;
  color: var(--rule);
}

@media (max-width: 34rem) {
  .entry { grid-template-columns: 1fr; }
  .entry-date { grid-row: 2; margin-bottom: 0.2rem; }
  .entry-body { margin-top: 0.15rem; }
}

/* ---------- education table ------------------------------------------- */

.degrees { display: flex; flex-direction: column; gap: 0.7rem; }
.degree {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1.5rem;
  align-items: baseline;
}
.degree-name { font-weight: 500; }
.degree-fields { display: block; font-size: 0.95rem; }
.degree-where { color: var(--muted); display: block; font-size: 0.95rem; }
.degree-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pub-title {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.25rem;
}

.pub-authors, .pub-venue {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.pub-authors .me { color: var(--ink); font-weight: 500; }
.pub-venue { font-style: italic; }

.pub-links {
  margin: 0.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
}
.pub-links a { text-decoration: none; }
.pub-links a:hover { text-decoration: underline; }

.year-rule {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.more-link { margin-top: 1.3rem; }

/* ---------- callout --------------------------------------------------- */

.note {
  background: var(--raise);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  color: var(--muted);
  font-size: 0.97rem;
}
.note p { margin: 0; }
.note p + p { margin-top: 0.6rem; }

/* ---------- contact --------------------------------------------------- */

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact li { display: flex; gap: 0.5rem; }
.contact dt, .contact .label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: center;
}

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

.foot {
  border-top: 1px solid var(--rule);
  padding-block: 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  align-items: baseline;
}
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }
.foot .spacer { margin-left: auto; }

/* ---------- long-form prose (writing) --------------------------------- */

.post-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin: 0.7rem 0 0;
}

.prose { font-size: 1.03rem; }
.prose > * + * { margin-top: 1.15rem; }
.prose p, .prose ul, .prose ol, .prose pre { margin: 0; }
.prose h2 {
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 2.3rem;
}
.prose h3 { font-size: 1.08rem; font-weight: 600; margin-top: 1.9rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.35rem; }
.prose blockquote {
  margin: 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}
.prose code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: var(--raise);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}
.prose pre {
  background: var(--raise);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.9rem 1.05rem;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; font-size: 0.84rem; }
.prose img { max-width: 100%; height: auto; border-radius: 4px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.2rem; }
.prose figure { margin: 0; }
.prose figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 0.5rem; }

/* ---------- utility --------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--paper);
  color: var(--ink);
  padding: 0.6rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .masthead, .nav, .foot { display: none; }
  body { font-size: 11pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: none; }
  .entry-body, .pub-authors, .pub-venue, .entry-org, .muted { color: #333; }
}
