@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #f3f1ea;
  --ink: #16150f;
  --muted: #6f6a5f;
  --rule: rgb(22 21 15 / 0.13);
  --accent: #b23a26;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121110;
    --ink: #edeae2;
    --muted: #9c978b;
    --rule: rgb(237 234 226 / 0.14);
    --accent: #e26a50;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ol { margin: 0; padding: 0; font: inherit; }
ol { list-style: none; }
small { font-size: inherit; }
::selection { background: var(--accent); color: var(--paper); }

a {
  color: inherit;
  text-decoration: underline 1px var(--rule);
  text-underline-offset: 0.22em;
  transition: text-decoration-color 0.15s ease;
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 20px; }

/* Masthead */

/* Masthead: Mo's figure and his name share the rule, like a cover. The figure dissolves into the
   page from the waist down. On phones it sits above the name; from 900px it takes the left and the
   name stacks on the right. The figure is a cut-out illustration; in dark mode it sits on a paper
   plate so the black shirt doesn't disappear. */

.masthead { padding-top: 28px; }
.cover { display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; }
.name {
  font: 400 calc((100vw - 40px) / 5.3)/0.86 var(--serif);
  letter-spacing: -0.045em;
  margin-left: -0.05em;
  white-space: nowrap;
}
.figure { order: -1; display: block; width: 80%; max-width: 480px; margin: 0 auto 4px; }
.figure img { display: block; width: 100%; height: auto; }
@media (prefers-color-scheme: dark) {
  .figure img { padding: 20px 20px 0; background: #f3f1ea; }
}
.strip {
  position: relative;
  margin-top: 0;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  font-size: 14px;
}
.strip::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--ink);
  transform-origin: left;
}
.nav { display: flex; gap: 20px; }

/* Bar: the small header on every page but the home page. */

.bar { padding-top: 24px; }
.bar > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
  font-size: 14px;
}
.mark { font: 400 26px/1 var(--serif); letter-spacing: -0.02em; text-decoration: none; }

.intro { margin-top: 72px; }
.intro-note { margin-top: 20px; max-width: 30em; color: var(--muted); font: 400 clamp(19px, 0.6vw + 16px, 23px)/1.45 var(--serif); text-wrap: pretty; }

/* What I write about: the journal's topics, one line each. */

.about-topics { margin-top: 104px; }
.topic-list { margin: 0; }
.topic-list > div { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 4px; padding: 18px 0 20px; border-bottom: 1px solid var(--rule); }
.topic-list dt { font: 400 24px/1.2 var(--serif); letter-spacing: -0.012em; }
.topic-list dd { margin: 0; max-width: 36em; font-size: 16px; line-height: 1.55; }

.topics { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 28px; font-size: 15px; }
.topics a { color: var(--muted); text-decoration-color: transparent; }
.topics a:hover { color: var(--ink); text-decoration-color: currentColor; }
.topics a[aria-current="page"] { color: var(--ink); text-decoration-color: var(--ink); }
.page-title + .topics + .writing { margin-top: 40px; }
.meta a { color: inherit; }

.lede {
  margin-top: 0;
  max-width: 21em;
  font: 400 clamp(28px, 2vw + 16px, 46px)/1.14 var(--serif);
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

/* Experience: newest first. Years, then company and title, then one line on what Mo did. */

.work { margin-top: 104px; }
.roles li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 6px;
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--rule);
}
.years { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.who h3 { font: 400 26px/1.15 var(--serif); letter-spacing: -0.015em; }
.who h3 a { text-decoration-color: var(--rule); }
.who h3 .aside { margin-left: 8px; color: var(--muted); font: 400 14px/1 var(--sans); letter-spacing: 0; }
.who > span { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; }
.roles p { max-width: 36em; font-size: 16px; line-height: 1.55; text-wrap: pretty; }
.roles .earlier .who h3 { font-size: 20px; }

/* Featured: press and recognition, one tile each. */

.featured { margin-top: 104px; }
.press { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.press a {
  display: block;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.press b { display: block; font: 400 22px/1.2 var(--serif); letter-spacing: -0.01em; }
.press b::after { content: " ↗"; color: var(--muted); font: 400 14px/1 var(--sans); }
.press span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.press a:hover b { text-decoration: underline 1px currentColor; text-underline-offset: 0.16em; }

/* Writing: the latest posts on the home page, every post on /writing, three more under each post. */

.writing, .more { margin-top: 136px; }
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 13px;
}
.label-row a { color: var(--ink); }
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title title" "date mins";
  row-gap: 6px;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.entry time, .entry .mins { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.entry time { grid-area: date; }
.entry .mins { grid-area: mins; }
.entry .title {
  grid-area: title;
  font: 400 22px/1.25 var(--serif);
  letter-spacing: -0.01em;
  text-decoration: underline 1px transparent;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s ease;
}
.entry:hover .title { text-decoration-color: currentColor; }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 10px;
  padding: 22px 0 28px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.feature time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.feature .title {
  font: 400 clamp(28px, 2vw + 16px, 46px)/1.06 var(--serif);
  letter-spacing: -0.025em;
  text-wrap: balance;
  text-decoration: underline 1px transparent;
  text-underline-offset: 0.14em;
  transition: text-decoration-color 0.15s ease;
}
.feature:hover .title { text-decoration-color: currentColor; }
.feature .excerpt { max-width: 30em; color: var(--muted); font: 400 clamp(19px, 0.5vw + 16px, 22px)/1.45 var(--serif); }
.feature .more-link { margin-top: 4px; font-size: 14px; text-decoration: underline 1px var(--rule); text-underline-offset: 0.22em; }
.feature:hover .more-link { text-decoration-color: currentColor; }

.page-title {
  margin-top: 72px;
  font: 400 clamp(48px, 7vw, 120px)/0.95 var(--serif);
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.page-title + .writing { margin-top: 64px; }
.back { margin-top: 24px; font-size: 15px; }
.empty { padding: 20px 0; color: var(--muted); }

/* Post */

.post { margin-top: 64px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.meta span::before, .meta a::before { content: "·"; margin-right: 12px; }
.post-title {
  margin-top: 16px;
  max-width: 15em;
  font: 400 clamp(38px, 4.4vw + 14px, 76px)/1.02 var(--serif);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.prose { margin-top: 44px; max-width: 34em; font: 400 19px/1.62 var(--serif); }
.prose > * { margin: 0 0 1.15em; }
.prose h2, .prose h3 { margin: 2.1em 0 0.7em; font: 500 17px/1.4 var(--sans); letter-spacing: 0; }
.prose h3 { font-size: 16px; color: var(--muted); }
.prose h2 + h3 { margin-top: 0.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 0 0 0.8em; padding-left: 0.2em; }
.prose li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.prose strong { font-weight: 600; }
.prose a { text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose blockquote { padding-left: 1em; border-left: 2px solid var(--accent); font-style: italic; }
.prose img { max-width: 100%; height: auto; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.prose code { font: 0.86em ui-monospace, SFMono-Regular, Menlo, monospace; }
.origin { margin-top: 40px; padding-top: 14px; max-width: 34em; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14px; }

.preview-bar { padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); color: var(--accent); font-size: 14px; }

/* Contact */

.contact { margin-top: 136px; }
.mail {
  font: 400 clamp(34px, 6.4vw, 92px)/1.05 var(--serif);
  letter-spacing: -0.03em;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}
.mail:hover { text-decoration-color: var(--accent); }

.foot { margin-top: 112px; padding-bottom: 32px; }
.foot div {
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.foot a { color: inherit; }

@media (min-width: 720px) {
  .wrap { padding-inline: 40px; }
  .masthead { padding-top: 40px; }
  .name { font-size: 14.6vw; }
}

@media (min-width: 900px) {
  .cover { grid-template-columns: 42% minmax(0, 1fr); column-gap: 40px; }
  /* Sized so "Mbalam" (about 3.65em) fills the left column. */
  .name { font-size: calc(15.9vw - 18px); white-space: normal; margin-bottom: -0.05em; }
  .name span { display: block; }
  .figure { width: 100%; max-width: none; margin: 0; }
  .entry:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
  .entry {
    grid-template-columns: 104px minmax(0, 1fr) auto;
    grid-template-areas: "date title mins";
    column-gap: 32px;
    align-items: baseline;
    padding: 22px 0 24px;
  }
  .entry .title { font-size: 26px; }
  .roles li {
    grid-template-columns: 104px minmax(0, 0.9fr) minmax(0, 1.1fr);
    column-gap: 32px;
    align-items: baseline;
    padding: 26px 0 28px;
  }
  .years { font-size: 16px; }
  .roles p { font-size: 17px; }
  .press { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; }
  .press a:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
  .feature {
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-areas: "date title" ". excerpt" ". more";
    column-gap: 32px;
    padding: 30px 0 34px;
  }
  .feature time { grid-area: date; padding-top: 0.7em; font-size: 16px; }
  .feature .title { grid-area: title; }
  .feature .excerpt { grid-area: excerpt; }
  .feature .more-link { grid-area: more; justify-self: start; }
  .feature:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
  .entry time, .entry .mins { font-size: 16px; }
  .prose { font-size: 20px; }
}

@media (min-width: 1100px) {
  .wrap { padding-inline: 56px; }
  .name { font-size: min(calc(15.9vw - 23px), 172px); }
  /* The lede, post titles and post text all start on the same line, two-thirds across. */
  .intro { margin: 136px 0 0 calc((100% - 48px) / 3 + 48px); }
  .about-topics { margin-top: 168px; }
  .topic-list > div { grid-template-columns: 104px minmax(0, 0.9fr) minmax(0, 1.1fr); column-gap: 32px; align-items: baseline; padding: 24px 0 26px; }
  .topic-list dt { grid-column: 2; }
  .topic-list dd { grid-column: 3; font-size: 17px; }
  .work, .featured { margin-top: 168px; }
  .writing { margin-top: 168px; }
  .contact { margin-top: 200px; }
  .post {
    margin-top: 96px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: 48px;
    align-items: start;
  }
  .meta { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 32px; padding-top: 22px; flex-direction: column; }
  .meta span::before, .meta a::before { content: none; }
  .post-title, .prose, .origin { grid-column: 2; }
  .post-title { margin-top: 0; }
  .page-title { margin-top: 96px; }
}

@media (prefers-reduced-motion: no-preference) {
  .name { animation: rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .strip::before { animation: draw 1.1s 0.15s cubic-bezier(0.6, 0, 0.2, 1) both; }
  .strip > * { animation: fade 0.8s 0.5s both; }
  .lede { animation: rise 1s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .figure { animation: fade 1.2s 0.1s ease-out both; }

  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
  @keyframes fade { from { opacity: 0; } }
  @keyframes draw { from { transform: scaleX(0); } }
}
