/*
 * Johann Schleier-Smith — site styles
 *
 * One hand-written stylesheet. No framework, no build step, no web fonts.
 * Edit this file directly; there is nothing to compile.
 *
 * Design system, settled by exploration (see VISUAL_STYLE.md):
 *   Type      system serif for reading, system sans for the technical voice
 *   Structure the index — an aligned date column carries the page
 *   Surface   cool paper, one blue doing links and emphasis, no warm accent
 *   Rules     no hairlines between rows; separation is by air alone
 */

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

:root {
  /* Cool paper, near-black ink. One blue is the only chromatic colour on
     the site; it does links, emphasis and state. There is no second accent. */
  --canvas:      #f6f7f8;
  --ink:         #1c1e21;
  --slate:       #52585f;
  --slate-soft:  #666d75;
  --link:        #17518c;
  --link-hover:  #0f3a66;
  --rule:        #e0e3e6;
  --rule-strong: #b3bac1;
  --mark:        #e7ebee;

  /* Type. Editorial serif for reading, sans for the technical voice. */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --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. The reading column stays ~65-72 characters. */
  --measure: 41rem;
  --index: 48rem;      /* the site width; carries the date column */
  --readable: 35rem;   /* running prose inside the index width (~64 chars) */
  --gutter: 1.25rem;

  /* The index grid. Shared by writing, talks, projects and publications so
     the left column lands in the same place on every page. */
  --col-date: 6.2rem;
  --col-type: 4.9rem;
  --col-gap: 1.15rem;

  /* Spacing rhythm */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;
}

@media (min-width: 40em) {
  :root { --gutter: 2rem; }
}

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

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 40em) {
  body { font-size: 1.125rem; }
}

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

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--s7) 0;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.13em;
  text-decoration-color: var(--rule-strong);
  transition: color 90ms linear, text-decoration-color 90ms linear;
}

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

a:focus-visible,
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 1px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

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

/* One width for the whole site. Every page — header, index, article, footer —
   hangs off the same left edge; running prose is narrowed inside it rather
   than re-centred, so that edge never moves. */
.wrap {
  width: 100%;
  max-width: var(--index);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.wrap-index { max-width: var(--index); } /* alias, kept for clarity in markup */

.lede,
.note,
.prose,
.inquiry,
.intro h1,
.footnotes,
.page-section > p { max-width: var(--readable); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--canvas);
  padding: var(--s3) var(--s4);
  font-family: var(--sans);
  font-size: 0.9rem;
  z-index: 10;
}

.skip-link:focus { left: 0; }

main { display: block; }

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

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--canvas);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s2) var(--s5);
  padding-top: var(--s4);
  padding-bottom: var(--s3);
}

.site-name {
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}

.site-name:hover { color: var(--ink); }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
}

.site-nav a {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  color: var(--slate);
  text-decoration: none;
  padding: 0.625rem 0; /* keeps the tap target at ~45px */
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--ink); }

.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--link);
}

@media (max-width: 24em) {
  .site-header .wrap { padding-bottom: var(--s2); }
  .site-nav { flex-basis: 100%; }
  .site-nav ul { gap: var(--s2) var(--s4); }
}

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

.site-footer {
  margin-top: var(--s8);
  border-top: 1px solid var(--rule);
  padding-top: var(--s5);
  padding-bottom: var(--s7);
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--slate);
}

.site-footer ul {
  list-style: none;
  margin: 0 0 var(--s3);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
}

.site-footer a { color: var(--slate); }
.site-footer a:hover { color: var(--ink); }
.site-footer .colophon { margin: 0; color: var(--slate-soft); }

/* ---------------------------------------------------------- typography */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

@media (min-width: 40em) {
  h1 { font-size: 2.375rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.1875rem; }
}

p { margin: 0 0 var(--s5); }

.lede {
  font-size: 1.125rem;
  color: var(--slate);
  margin-top: var(--s4);
}

@media (min-width: 40em) {
  .lede { font-size: 1.25rem; }
}

/* Small sans "technical voice" for labels, dates and section headings. */
.eyebrow,
.section-label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--slate);
}

/* A section label keeps its rule — it is a heading, not a row separator. */
.section-label {
  display: block;
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: var(--s4);
}

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

.page-header {
  padding-top: var(--s7);
  padding-bottom: var(--s6);
}

.page-header .lede { margin-bottom: 0; }

.page-section { padding-top: var(--s7); }
.page-section:first-of-type { padding-top: var(--s6); }

.more {
  font-family: var(--sans);
  font-size: 0.875rem;
  margin: var(--s5) 0 0;
}

.more a { text-decoration-color: var(--rule-strong); }
.more a + a { margin-left: var(--s4); }

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

.intro {
  padding-top: var(--s7);
  padding-bottom: 0;
}

.intro h1 {
  font-size: 1.875rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

@media (min-width: 40em) {
  .intro { padding-top: var(--s8); }
  .intro h1 { font-size: 2.625rem; }
}

.intro p { margin-bottom: var(--s4); }
.intro .lede { margin-top: var(--s5); color: var(--ink); }

.intro-links {
  font-family: var(--sans);
  font-size: 0.9375rem;
  margin-top: var(--s5);
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
  align-items: baseline;
}

.intro-links a { padding: var(--s1) 0; }
.intro-links .sep { color: var(--rule-strong); user-select: none; }
.intro-links .quiet { color: var(--slate); }

/* ------------------------------------------------------ current inquiry
   The one place on the site that carries a coloured mark. Everything else
   earns emphasis from weight and position. */

.inquiry {
  border-left: 2px solid var(--link);
  padding-left: var(--s5);
  margin-top: var(--s7);
}

.inquiry h2 {
  font-size: 1.125rem;
  margin-bottom: var(--s3);
}

.inquiry p:last-child { margin-bottom: 0; }
.inquiry .more { margin-top: var(--s4); }

/* ============================================================ THE INDEX
   Shared by writing, talks, projects and publications. Below 40em it
   stacks; above, it becomes an aligned grid and the rows lose their rules,
   because the date column is doing the structural work instead.
   ==================================================================== */

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

.entry { padding: var(--s4) 0; }

.entry-meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--slate-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s1) var(--s3);
  margin: 0 0 var(--s1);
}

.entry-meta time { font-variant-numeric: tabular-nums; }

/* No accent hue: the type label is set apart by case and weight. */
.entry-meta .type {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--slate);
}

.entry-title {
  font-family: var(--serif);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  text-wrap: pretty;
}

.entry-title a {
  color: var(--ink);
  text-decoration: none;
}

.entry-title a:hover {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.13em;
}

.entry-summary {
  margin: var(--s1) 0 0;
  font-size: 1rem;
  color: var(--slate);
  line-height: 1.5;
}

.entry-links {
  font-family: var(--sans);
  font-size: 0.8125rem;
  margin: var(--s2) 0 0;
}

.entry-links a { margin-right: var(--s4); }

/* Start / last-updated line under a project's purpose. */
.entry-dates {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--slate-soft);
  margin: var(--s2) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
}

@media (min-width: 40em) {
  /* Three columns: date, type, then title and summary together. */
  .entry {
    display: grid;
    grid-template-columns: var(--col-date) var(--col-type) 1fr;
    column-gap: var(--col-gap);
    align-items: start;
    padding: var(--s3) 0 var(--s4);
  }

  .entry-meta { display: contents; }
  .entry-meta time { grid-column: 1; padding-top: 0.42em; }
  .entry-meta .type { grid-column: 2; padding-top: 0.42em; }

  .entry-title,
  .entry-summary,
  .entry-links { grid-column: 3; }

  .entry-title { font-size: 1.1875rem; }

  /* Two-column variant: no type slot (talks, projects, publications). */
  .entries-2col .entry { grid-template-columns: var(--col-date) 1fr; }
  .entries-2col .entry-meta time,
  .entries-2col .entry-meta .status { grid-column: 1; }
  .entries-2col .entry-meta .venue,
  .entries-2col .entry-meta .updated { grid-column: 2; padding-top: 0.42em; }
  .entries-2col .entry-title,
  .entries-2col .entry-summary,
  .entries-2col .entry-links,
  .entries-2col .entry-dates { grid-column: 2; }

  .entry-dates { grid-column: 3; }
}

/* Year headings inside an archive. */
.entries + .section-label { margin-top: var(--s7); }

/* Topic index above the archive. */
.topic-index {
  font-family: var(--sans);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s2) var(--s4);
  margin: var(--s5) 0 0;
  padding-top: var(--s4);
  border-top: 1px solid var(--rule);
}

.topic-index .eyebrow { flex: 0 0 auto; }
.topic-index a { padding: var(--s1) 0; }

/* -------------------------------------------------------------- status */

.status {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.1em 0.45em;
  white-space: nowrap;
}

/* Status is always spelled out; the outline only reinforces it. */
.status-exploring,
.status-active { color: var(--link); border-color: var(--link); }

/* ------------------------------------------------------- research trail */

.trail {
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--slate-soft);
  margin: var(--s5) 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s2);
}

.trail li::after {
  content: "\2192";
  margin-left: var(--s2);
  color: var(--rule-strong);
}

.trail li:last-child::after { content: none; }
.trail .now { color: var(--link); font-weight: 600; }

/* --------------------------------------------------------- article page */

.post-header {
  padding-top: var(--s7);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s6);
}

.post-header h1 { text-wrap: pretty; }

.post-header .subtitle {
  font-family: var(--serif);
  font-size: 1.1875rem;
  font-weight: 400;
  font-style: italic;
  color: var(--slate);
  margin: var(--s3) 0 0;
  line-height: 1.35;
}

@media (min-width: 40em) {
  .post-header .subtitle { font-size: 1.3125rem; }
}

.post-meta {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--slate);
  margin-top: var(--s5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
  align-items: baseline;
}

.post-meta .type {
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  color: var(--slate);
}

.post-meta .topic { color: var(--slate-soft); }

.post-meta a.topic {
  color: var(--slate-soft);
  text-decoration-color: var(--rule);
}

.post-meta a.topic:hover { color: var(--ink); }

.prose {
  font-size: 1.0625rem;
  line-height: 1.7;
}

@media (min-width: 40em) {
  .prose { font-size: 1.1875rem; line-height: 1.72; }
}

/* A stray h1 in body markdown is styled as a section heading, not a title. */
.prose > h1,
.prose > h2 {
  font-size: 1.375rem;
  margin-top: var(--s7);
  margin-bottom: var(--s4);
}

.prose > h3 {
  font-size: 1.125rem;
  margin-top: var(--s6);
  margin-bottom: var(--s3);
}

@media (min-width: 40em) {
  .prose > h1,
  .prose > h2 { font-size: 1.625rem; }
  .prose > h3 { font-size: 1.25rem; }
}

.prose > h4 {
  font-family: var(--sans);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  margin-top: var(--s6);
  margin-bottom: var(--s3);
}

.prose ul, .prose ol {
  margin: 0 0 var(--s5);
  padding-left: 1.35em;
}

.prose li { margin-bottom: var(--s2); }
.prose li > ul, .prose li > ol { margin-top: var(--s2); }

.prose blockquote {
  margin: var(--s6) 0;
  padding-left: var(--s5);
  border-left: 2px solid var(--rule-strong);
  color: var(--slate);
  font-style: italic;
}

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

.prose img {
  display: block;
  margin: var(--s6) auto;
  border: 1px solid var(--rule);
  background: #fff;
}

.prose figure { margin: var(--s6) 0; }

.prose figcaption,
.prose img + em {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--slate);
  line-height: 1.5;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--mark);
  padding: 0.1em 0.3em;
  border-radius: 2px;
}

.prose pre {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: var(--s4);
  overflow-x: auto;
  margin: var(--s6) 0;
}

.prose pre code { background: none; padding: 0; font-size: inherit; }

.prose table {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9375rem;
  margin: var(--s6) 0;
}

.prose th, .prose td {
  border-bottom: 1px solid var(--rule);
  padding: var(--s2) var(--s4) var(--s2) 0;
  text-align: left;
  vertical-align: top;
}

.prose th { font-weight: 600; border-bottom-color: var(--rule-strong); }

.prose sup a { text-decoration: none; }

/* Dated editorial note prepended to an older post. */
.prose blockquote.editorial-note {
  border-left-color: var(--link);
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.prose > *:first-child { margin-top: 0; }

.footnotes {
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--slate);
}

/* ------------------------------------------------- article related area */

.post-footer {
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--rule-strong);
}

.page-section + .post-footer,
.entries + .post-footer { margin-top: var(--s6); }

.post-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
  font-family: var(--sans);
  font-size: 0.875rem;
}

.post-nav li { flex: 1 1 14rem; }

.post-nav .dir {
  display: block;
  color: var(--slate-soft);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--s1);
}

.post-nav a { color: var(--link); text-decoration-color: var(--rule-strong); }

/* --------------------------------------------------------- project page */

.project-header {
  padding-top: var(--s7);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s6);
}

.project-meta {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--slate);
  margin-top: var(--s5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
  align-items: baseline;
}

.project-meta time { font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------- pub lists */

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

.pub { padding: var(--s3) 0 var(--s4); }

.pub-title {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.35;
  margin: 0;
  text-wrap: pretty;
}

.pub-title a { color: var(--ink); text-decoration: none; }

.pub-title a:hover {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.13em;
}

.pub-authors,
.pub-venue {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--slate);
  margin: var(--s1) 0 0;
  line-height: 1.5;
}

.pub-venue {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
  align-items: baseline;
}

.pub-venue .venue { font-weight: 600; color: var(--ink); }
.pub-venue time { font-variant-numeric: tabular-nums; }
.pub-venue a { color: var(--link); }

@media (min-width: 40em) {
  /* Publications hang off the same date column as everything else. */
  .pub {
    display: grid;
    grid-template-columns: var(--col-date) 1fr;
    column-gap: var(--col-gap);
    align-items: start;
  }
  .pub-date {
    grid-column: 1;
    font-family: var(--sans);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--slate-soft);
    font-variant-numeric: tabular-nums;
    padding-top: 0.42em;
  }
  .pub-title, .pub-authors, .pub-venue { grid-column: 2; }
}

.pub-date {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--slate-soft);
  font-variant-numeric: tabular-nums;
  margin: 0 0 var(--s1);
}

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.note {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--slate);
  line-height: 1.55;
}
