/* Typography follows buildingslack.com: Lato, 17px/1.6 body, 720px measure. */

:root {
  --text: #333;
  --heading: #15171a;
  --muted: #999;
  --meta: #777;
  --desc: #333;
  --rule: #e6e6e6;
  --code-bg: #f6f6f6;
  --bg: #fff;
  --accent: #1264a3;
  --link-hover: rgba(29, 155, 209, 0.12);
  --font-sans: Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: Fraunces, Georgia, serif;
  --font-mono: "Source Code Pro", Menlo, Consolas, Monaco, "Liberation Mono", monospace;
  --measure: 720px;
  --gap: 2.4rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #d4d4d4;
    --heading: #f2f2f2;
    --muted: #999;
    --meta: #a3a3a3;
    --desc: #b5b5b5;
    --rule: #2e2e2e;
    --code-bg: #1e1e1e;
    --bg: #121212;
    --accent: #1d9bd1;
    --link-hover: rgba(29, 155, 209, 0.18);
  }
}

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

html { font-size: 62.5%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.6rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, blockquote, figure, dl, dd { margin: 0; }

h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 50, "WONK" 0;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

a { color: var(--heading); text-decoration: none; }
a:hover { opacity: 0.8; }

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

/* Layout */

.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex-grow: 1; padding: 6vmin 0; }

.canvas {
  width: min(var(--measure), 100% - var(--gap) * 2);
  margin-inline: auto;
}

.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  padding: 4rem 0;
  color: var(--muted);
  font-size: 1.3rem;
}
.site-foot a { color: var(--muted); }

/* Home page mark: a rotating 19th-century engraving (see _data/marks.yml). */

.mark { margin-top: 3vmin; }
.mark-img {
  display: block;
  height: var(--h);
  aspect-ratio: var(--r);
  background: var(--heading);
  -webkit-mask: var(--u) no-repeat left bottom / contain;
  mask: var(--u) no-repeat left bottom / contain;
}
.mark + script + .feed { margin-top: 2.6rem; }

/* Home page lists */

.feed { margin-top: 3vmin; }
.feed + .feed { margin-top: 6rem; }

.feed-heading {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-variation-settings: normal;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.feed-item {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.5rem 0;
  line-height: 1.3;
}
.feed-item + .feed-item { border-top: 1px solid var(--rule); }

.feed-date {
  flex-shrink: 0;
  width: 11rem;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.feed-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  font-variation-settings: "SOFT" 50, "WONK" 0;
  letter-spacing: -0.005em;
}

.feed-main { display: flex; flex-direction: column; gap: 0.3rem; }
.feed-venue { color: var(--meta); font-size: 1.4rem; font-style: italic; }

.feed-name { flex-shrink: 0; width: 11rem; white-space: nowrap; }
.feed-arrow {
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.12em;
  vertical-align: baseline;
  color: var(--meta);
  transition: color 0.15s, transform 0.15s;
}
.feed-name:hover, .feed-name:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.feed-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.feed-name:hover .feed-arrow, a.feed-item:hover .feed-arrow { color: var(--accent); transform: translate(1px, -1px); }
.feed-desc { color: var(--desc); font-size: 1.5rem; font-style: italic; }

.feed-projects .feed-item { align-items: center; padding: 0.8rem 0; }
.feed-projects .feed-item + .feed-item { border-top: 0; }

/* Post */

.post-header { margin-bottom: 3.2rem; }

.post-meta {
  margin-bottom: 1rem;
  color: var(--meta);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
}
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: inherit;
}
.post-back:hover { opacity: 1; color: var(--heading); }
.post-draft { margin-left: 1rem; color: var(--accent); }

.post-title {
  font-size: 4rem;
  line-height: 1.2;
  word-break: break-word;
}

.post-excerpt { margin-top: 2rem; font-size: 1.8rem; }

/* Article body */

.content { font-size: 1.7rem; word-break: break-word; }

.content > * + * { margin-top: 1.25em; }
.content > :is(h2, h3, h4) { margin-top: 1.6em; }
.content > :is(h2, h3, h4) + * { margin-top: 0.8em; }
.content > :not(h2, h3, h4) + blockquote { margin-top: 1.6em; }

.content :is(h2, h3, h4) { font-weight: 500; }
.content h2 { font-size: 1.6em; }
.content h3 { font-size: 1.2em; }
.content h4 { font-size: 1.05em; }

.content a, .feed-desc a {
  border-radius: 3px;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: auto;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.content :is(ul, ol) { padding-left: 2.8rem; margin-bottom: 0; }
.content li + li, .content li :is(ul, ol) { margin-top: 0.25em; }

.content a:hover, .content a:focus-visible,
.feed-desc a:hover, .feed-desc a:focus-visible {
  opacity: 1;
  background: var(--link-hover);
  box-shadow: 0 0 0 0.15em var(--link-hover);
  outline: none;
}

.content .work li + li { margin-top: 0.9em; }

/* About page timeline */

.timeline { display: grid; gap: 1.6rem; }
.tl-row { display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; align-items: baseline; line-height: 1.4; }
.tl-years {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tl-place {
  display: block;
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  font-variation-settings: "SOFT" 50, "WONK" 0;
  letter-spacing: -0.005em;
}
.tl-what { display: block; margin-top: 0.2rem; color: var(--desc); font-size: 1.5rem; font-style: italic; }

.content blockquote {
  padding-left: 2rem;
  border-left: 3px solid var(--accent);
  font-size: 1.06em;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 350;
  font-variation-settings: "SOFT" 50, "WONK" 0;
}

.content hr {
  height: 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  background: var(--code-bg);
  border-radius: 3px;
}

.content pre {
  overflow-x: auto;
  padding: 1.8rem 2rem;
  background: var(--code-bg);
  border-radius: 4px;
  font-size: 0.92em;
  line-height: 1.5;
}
.content pre code { padding: 0; background: none; font-size: 1em; }

.content figcaption, .content img + em {
  display: block;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.4rem;
  text-align: center;
}

.content table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  font-size: 1.6rem;
}
.content th, .content td { border: 1px solid var(--rule); padding: 6px 12px; text-align: left; }
.content th { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.2px; text-transform: uppercase; }

@media (max-width: 767px) {
  .post-header { margin-bottom: 2.2rem; }
  .post-title { font-size: 3rem; }
  .post-excerpt { font-size: 1.7rem; }
  .feed-item { flex-direction: column; gap: 0.4rem; }
  .feed-projects .feed-item { align-items: flex-start; gap: 0.6rem; padding: 0.9rem 0; }
  .feed-name { width: auto; }
  .tl-row { grid-template-columns: 1fr; gap: 0.3rem; }
}

@media (max-width: 600px) {
  body { line-height: 1.5; }
  .content pre { padding: 1.4rem 1.6rem; font-size: 0.82em; }
}
