:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --faint: #d8d8d8;
  --link: #1a1a1a;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 40rem;
  margin: 0 auto;
  padding: 5.5rem 1.5rem 4rem;
}

/* header */

.site {
  margin: 0 0 2.75rem;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: 1.95rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* writing */

main { margin-top: 4.5rem; }

h2 {
  margin: 0 0 1.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.entry { margin-bottom: 2.5rem; }
.entry:last-child { margin-bottom: 0; }

.entry h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.45;
  font-weight: 600;
}

.soon {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  vertical-align: 0.1em;
}

.meta {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.desc {
  margin: 0.5rem 0 0;
  color: var(--ink);
}

/* footer */

footer {
  margin-top: 6rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--faint);
}

.links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.92rem;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  padding-bottom: 1px;
}

a:hover { border-bottom-color: var(--ink); }

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

/* small screens */

@media (max-width: 34rem) {
  .wrap { padding: 3.5rem 1rem 3rem; }
  h1 { font-size: 1.65rem; }
  main { margin-top: 3.5rem; }
  footer { margin-top: 4rem; }
}

/* ---------- post pages ---------- */

.post { max-width: 44rem; padding-top: 3rem; }

.back {
  margin: 0 0 3rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.post > .back:last-child {
  margin: 4.5rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--faint);
}

.post footer .back { margin: 1.25rem 0 0; }

.post h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.standfirst {
  margin: 0 0 1rem;
  font-size: 1.12rem;
  line-height: 1.55;
  color: #44444a;
}

.post .meta { margin: 0; }

.post h2 {
  margin: 3.25rem 0 1rem;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
}

.post h3 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.post p { margin: 0 0 1.15rem; }

/* hero */

.hero {
  margin: 2.25rem 0 2.75rem;
}
.hero img {
  display: block;
  width: 100%;
  height: auto;
  background: #f2f2ef;
}

/* figures */

figure { margin: 2.25rem 0; }

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #f2f2ef;
}

figcaption,
caption {
  margin-top: 0.7rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: left;
}

/* code */

pre {
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: #f7f7f4;
  border: 1px solid #ececea;
  border-radius: 3px;
  font-size: 0.85rem;
  line-height: 1.55;
}

pre code { font: inherit; background: none; padding: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #f4f4f1;
  padding: 0.05em 0.18em;
  border-radius: 2px;
}

/* tables */

.tablewrap { margin: 2rem 0; overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

caption {
  caption-side: bottom;
  margin-top: 0.85rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid #ececea;
  vertical-align: top;
}

thead th {
  border-bottom: 1px solid #c9c9c4;
  font-weight: 600;
  white-space: nowrap;
}

tfoot th, tfoot td {
  border-bottom: none;
  border-top: 1px solid #c9c9c4;
  font-weight: 600;
}

table.num td:not(:first-child),
table.num th:not(:first-child) {
  text-align: right;
  padding-right: 0;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }

/* link list */

.linklist {
  margin: 0 0 1.15rem;
  padding-left: 1.1rem;
}
.linklist li { margin-bottom: 0.35rem; }

@media (max-width: 34rem) {
  .post { padding-top: 2rem; }
  .post h1 { font-size: 1.55rem; }
  .standfirst { font-size: 1.02rem; }
  .post h2 { margin-top: 2.5rem; font-size: 1.18rem; }
  .back { margin-bottom: 2rem; }
  pre { font-size: 0.78rem; padding: 0.85rem; }
  table { font-size: 0.88rem; }
  th, td { padding-right: 0.6rem; }
}
