:root {
  --bg: #000;
  --fg: #e7e3da;
  --muted: #8a877f;
  --faint: #55534e;
  --rule: #222;
  --font: Jost, "Century Gothic", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Corner logo on content pages: globe radius and inset. site.js reads these too. */
  --logo-r: 34px;
  --logo-pad: 20px;
  --logo-word: 1;
  --header-h: calc(2 * (var(--logo-pad) + 1.13 * var(--logo-r)));
  --gutter: max(24px, env(safe-area-inset-left), env(safe-area-inset-right));
  color-scheme: dark;
}

@media (max-width: 560px) {
  /* Phones show only the globe, about as tall as the nav icons. The inset lines its left edge up with
     the page gutter. */
  :root { --logo-r: 8px; --logo-pad: 23px; --logo-word: 0; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 300 18px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--faint); transition: color 0.2s, text-decoration-color 0.2s; }
a:hover { color: #fff; text-decoration-color: currentColor; }
a:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

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

/* The globe canvas covers the first screen and scrolls with the page, so the corner logo scrolls
   away with the header on content pages. */
#globe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  display: block;
  z-index: 0;
}

/* ---- Header ---- */

.logo {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  padding-left: var(--gutter);
  height: var(--header-h);
  text-decoration: none;
  letter-spacing: 0.3em;
  font-size: 0.9rem;
}
[data-view="home"] .logo { visibility: hidden; }

.site-nav {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding-right: var(--gutter);
}
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current] { color: #fff; }
.site-nav .icon { width: 16px; height: 16px; }
.site-nav svg { display: block; width: 100%; height: 100%; fill: currentColor; }

/* ---- Home ---- */

[data-view="home"] { overflow: hidden; height: 100vh; height: 100svh; }

.hero { position: absolute; inset: 0; z-index: 1; pointer-events: none; transition: opacity 0.8s 0.7s, visibility 0s; }
.hero a { pointer-events: auto; }
[data-view="page"] .hero { opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0s 0.25s; }

.wordmark {
  position: absolute;
  top: 40%;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-weight: 300;
  font-size: clamp(1.6rem, 6vw, 4rem);
  letter-spacing: 0.3em;
  line-height: 1;
}

.steam {
  position: absolute;
  left: 50%;
  top: calc(40% + clamp(3rem, 9vw, 6rem));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.75em 1.4em;
  border: 1px solid rgba(231, 227, 218, 0.45);
  color: var(--fg);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s, opacity 1.2s;
}
.steam:hover { border-color: #fff; background: #fff; color: #000; }
.steam svg { width: 1.3em; height: 1.3em; fill: currentColor; flex: none; }

/* The intro reveals the nav and button once the globe has settled. */
.js .site-nav, .js .steam, .js .wordmark { opacity: 0; transition: opacity 1.2s; }
.js .revealed .site-nav, .js .revealed .steam, .js .no-gl .wordmark { opacity: 1; }

/* ---- Content ---- */

#content { position: relative; z-index: 1; }
[data-view="home"] #content { display: none; }
#content.out { opacity: 0; transition: opacity 0.25s; }
#content.in { animation: content-in 0.7s ease 0.55s both; }
#content.in-fast { animation: content-in 0.4s ease both; }
@keyframes content-in { from { opacity: 0; transform: translateY(10px); } }

.column {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 56px) var(--gutter) 0;
}

h1, h2, h3, h4, h5, h6 { font-weight: 300; line-height: 1.3; letter-spacing: 0.02em; }

.page-title {
  margin: 0 0 56px;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.post-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
}
.post-meta time, .post-meta span { white-space: nowrap; }
/* The space before each tag is the line break opportunity; the dot replaces it visually. */
.post-meta span::before { content: "·"; margin: 0 0.9em 0 0.6em; color: var(--faint); }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 0 0 44px; margin: 0 0 44px; border-bottom: 1px solid var(--rule); }
.post-list li:last-child { border-bottom: 0; }
.post-list h2 { margin: 6px 0 12px; font-size: 1.55rem; }
.post-list h2 a { text-decoration: none; }
.post-list p { margin: 0; color: #bdb9b0; }
.post-hero { display: block; margin: 0 0 22px; }
.post-hero img { display: block; width: 100%; height: auto; background: #0a0a0a; }
.post-list .empty { color: var(--muted); border: 0; }

.post header { margin-bottom: 48px; }
.post h1 { margin: 10px 0 0; font-size: clamp(1.9rem, 5vw, 2.6rem); letter-spacing: 0.04em; }

.post-content { color: #d6d2c9; }
.post-content h1, .post-content h2, .post-content h3, .post-content h4 { color: var(--fg); margin: 2.4em 0 0.8em; }
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.05rem; letter-spacing: 0.1em; }
/* The junkship posts use h5/h6 as figure captions. */
.post-content h5, .post-content h6 {
  margin: 2.6em 0 0.9em;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: lowercase;
}
.post-content img, .post-content video, .post-content iframe { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.post-content p:has(> img:only-child) { margin: 1.6em 0; }
.post-content blockquote { margin: 1.6em 0; padding-left: 22px; border-left: 1px solid var(--faint); color: var(--muted); }
.post-content hr { border: 0; border-top: 1px solid var(--rule); margin: 3em 0; }
.post-content ul, .post-content ol { padding-left: 1.2em; }
.post-content li + li { margin-top: 0.3em; }
.post-content table { border-collapse: collapse; width: 100%; font-size: 0.9em; }
.post-content th, .post-content td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); }

code, pre { font: 0.8rem/1.6 var(--mono); }
:not(pre) > code { padding: 0.1em 0.35em; border: 1px solid var(--rule); color: var(--fg); }
pre {
  margin: 1.6em 0;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: #070707;
  color: #cfcbc2;
}
.highlight { margin: 1.6em 0; }
.highlight pre { margin: 0; }

/* Monochrome syntax colours. */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .ch, .highlight .cpf { color: #6b6862; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .kc, .highlight .cp { color: #fff; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr { color: #a9a59c; }
.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il { color: #a9a59c; }
.highlight .nf, .highlight .nc, .highlight .nn { color: #ece8df; text-decoration: underline; text-decoration-color: #3a3935; text-underline-offset: 0.25em; }
.highlight .o, .highlight .ow, .highlight .p { color: #8a877f; }
.highlight .err { color: inherit; background: none; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 80px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}
.pager a { max-width: 48%; text-decoration: none; color: var(--fg); }
.pager a span { display: block; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.25em; }
.pager .next { text-align: right; margin-left: auto; }

.site-footer {
  margin-top: 96px;
  padding: 24px 0 48px;
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
}

@media (max-width: 560px) {
  html, body { font-size: 16px; }
  .site-nav ul { gap: 15px; }
  .site-nav a { font-size: 0.75rem; letter-spacing: 0.22em; }
  .site-nav .icon { width: 15px; height: 15px; }
  .column { padding-top: calc(var(--header-h) + 32px); }
  .post-list h2 { font-size: 1.3rem; }
  pre { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); border-left: 0; border-right: 0; }
}

@media (max-width: 400px) {
  .site-nav ul { gap: 12px; }
  .site-nav a { letter-spacing: 0.16em; }
  .site-nav .icon { width: 14px; height: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
h1:focus { outline: none; }
