@font-face { font-family: Fraunces; font-weight: 400; font-display: swap; src: url(fonts/fraunces-400.woff2) format("woff2"); }
@font-face { font-family: Fraunces; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/fraunces-400i.woff2) format("woff2"); }
@font-face { font-family: Fraunces; font-weight: 600; font-display: swap; src: url(fonts/fraunces-600.woff2) format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/plexmono-500.woff2) format("woff2"); }

:root {
  --air: #dfe6dc;
  --loam: #261b17;
  --loam-deep: #1a1210;
  --pit: #130d0b;
  --seam: #3d2d25;
  --bark: #33241d;
  --root: #e6d9bd;
  --text: #d6c9ad;
  --faint: #a8987c;
  --link: #cfe0c6;
  --gutter: clamp(20px, 6vw, 96px);
  --measure: 66ch;
  --roots-h: 120px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font: 400 1.0625rem/1.68 Fraunces, Georgia, "Times New Roman", serif;
  background: var(--loam-deep);
  color: var(--text);
  overflow-x: hidden;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--bark); color: var(--air); padding: 6px 12px; z-index: 5; }
.skip:focus { left: 8px; }

/* ---- above ground: navigation and the name */
.air {
  background: var(--air);
  color: var(--bark);
  padding: 18px var(--gutter) 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: 150px;
}
.air nav { display: flex; flex-wrap: wrap; gap: 4px clamp(16px, 2.4vw, 34px); font-size: 1.0625rem; }
.air nav a { color: var(--bark); text-decoration: none; padding: 4px 0; }
.air nav a:hover, .air nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.air nav :focus-visible { outline-color: var(--bark); }
.air nav .lang { margin-left: auto; }
.mark {
  display: block;
  width: max-content;
  margin: 0;
  margin-bottom: -0.115em; /* the letters stand on the ground line */
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--bark);
  text-decoration: none;
  white-space: nowrap;
}
.home { --roots-h: clamp(230px, 34svh, 360px); }
.home .air { min-height: 36svh; }
.home .mark { font-size: clamp(3.4rem, 21.5vw, 13rem); }

/* ---- below ground: the content */
.soil {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(var(--loam), var(--loam-deep) 700px);
  padding: var(--roots-h) var(--gutter) 0;
}
#roots { position: absolute; top: 0; left: 0; width: 100%; height: var(--roots-h); pointer-events: none; }
main { position: relative; flex: 1; max-width: var(--measure); padding-bottom: clamp(56px, 10vh, 120px); }

h1, h2, h3 { color: var(--root); font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
main h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: 0.7em; text-wrap: balance; }
main h2 { font-size: clamp(1.45rem, 2.6vw, 1.85rem); }
.lede { font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.35; color: var(--root); margin: 0 0 2.4em; max-width: 26ch; }
section { margin-top: 3.2rem; }
section h2 { margin-bottom: 0.6rem; }
.empty { color: var(--faint); margin: 0.4rem 0 0; }
.more { display: inline-block; margin-top: 1rem; }

.entries { list-style: none; margin: 0; padding: 0; }
.entries li { display: grid; grid-template-columns: 17ch 1fr; gap: 0 1.5rem; padding: 0.95rem 0; border-top: 1px solid var(--seam); }
.entries li:last-child { border-bottom: 1px solid var(--seam); }
.entries time { white-space: nowrap; color: var(--faint); font-size: 0.95rem; padding-top: 0.2em; font-variant-numeric: tabular-nums; }
.entries a { font-size: 1.25rem; font-weight: 600; line-height: 1.25; color: var(--root); text-decoration: none; }
.entries a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.entries p { margin: 0.25rem 0 0; }
@media (max-width: 560px) { .entries li { grid-template-columns: 1fr; } }

.meta { display: flex; gap: 1.1rem; margin: 0 0 1rem; color: var(--faint); font-size: 0.98rem; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose h2 { margin: 2.2em 0 0.6em; }
.prose h3 { font-size: 1.25rem; margin: 1.8em 0 0.5em; }
.prose li { margin-bottom: 0.35em; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--root); font-weight: 600; }
.prose blockquote { margin: 1.5em 0; padding-left: 1.2em; border-left: 2px solid var(--faint); color: var(--root); font-style: italic; }
.prose img { max-width: 100%; height: auto; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.5em 0; font-size: 0.98rem; }
.prose th, .prose td { text-align: left; padding: 0.5em 0.9em 0.5em 0; border-bottom: 1px solid var(--seam); }
.prose th { color: var(--root); font-weight: 600; }

/* code: the digits the roots are made of */
code, pre { font-family: "Plex Mono", ui-monospace, Menlo, Consolas, monospace; font-weight: 500; }
.prose code { font-size: 0.86em; background: var(--pit); padding: 0.12em 0.36em; border-radius: 3px; color: var(--root); }
.prose pre { margin: 0; padding: 1.05rem 1.2rem; overflow-x: auto; font-size: 0.86rem; line-height: 1.6; color: var(--text); }
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.prose .code { background: var(--pit); margin: 1.5em 0; border-radius: 4px; }
.prose > pre { background: var(--pit); margin: 1.5em 0; border-radius: 4px; }
@media (min-width: 900px) { .prose .code, .prose > pre { margin-right: -8ch; } }
.code .c, .code .c1, .code .cm, .code .ch { color: #8f8068; }
.code .k, .code .kd, .code .kn, .code .kr, .code .kc, .code .nt { color: var(--root); font-weight: 500; }
.code .s, .code .s1, .code .s2, .code .sa, .code .sb, .code .sr { color: #b9d1ac; }
.code .m, .code .mi, .code .mf, .code .mh { color: #e0b98a; }
.code .nf, .code .nx.nf, .code .nc, .code .na { color: #cfe0c6; }

footer { position: relative; display: flex; gap: 1.5rem; justify-content: space-between; padding: 1.3rem 0 1.6rem; border-top: 1px solid var(--seam); color: var(--faint); font-size: 0.98rem; }
footer a { color: var(--faint); }

/* wide tables scroll inside themselves on small screens */
.prose table { display: block; overflow-x: auto; }
.prose td, .prose th { vertical-align: top; min-width: 9ch; }
.prose > p:first-child > em:only-child { color: var(--faint); }

/* ---- the world page: the sky of the world continues the air of the header */
.world { --roots-h: 0px; }
.world #roots { display: none; }
.world .mark { margin-bottom: 14px; }
.world main { max-width: none; }
.world main > h1, .world main > .prose { max-width: var(--measure); }
.world main > h1 { margin-top: 2.6rem; font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.world-wrap { margin: 0 calc(-1 * var(--gutter)); background: var(--air); line-height: 0; }
#world { display: block; width: 100%; touch-action: none; outline-offset: -3px; }
#map { display: block; width: 100%; height: 30px; touch-action: none; cursor: pointer; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tools button {
  font: 500 0.95rem/1 Fraunces, Georgia, serif; color: var(--text); background: none; white-space: nowrap;
  border: 1px solid var(--seam); border-radius: 999px; padding: 0.62em 1em; cursor: pointer;
}
.tools button:hover { border-color: var(--faint); color: var(--root); }
.tools button[aria-pressed="true"] { background: var(--root); border-color: var(--root); color: var(--loam-deep); }
.tools.ctl { margin-top: 10px; }
.tools.ctl button { border-style: dashed; }
/* on a phone the tools sit in one row that scrolls sideways, so the world stays in view */
@media (max-width: 640px) {
  #tools { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px 0; scrollbar-width: thin; }
}
.stats { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 16px 0 0; font: 500 0.82rem/1.5 "Plex Mono", ui-monospace, monospace; }
.stats .when { color: var(--root); flex-basis: 100%; }
#chart { display: block; width: 100%; max-width: 760px; height: 84px; margin-top: 8px; border-bottom: 1px solid var(--seam); }
footer a[href^="mailto"] { margin-left: auto; }
