/* The whole site's look, after a record sleeve: black rules, wide bold
   capitals (Archivo, loaded in _includes/base.njk) and one red accent,
   dark or light with the system. Colours are the tokens below; change
   them there. */

:root {
  --bg: #ffffff;
  --surface: #f2f2f2;
  --rule: #111111;
  --border: #d4d4d4;
  --text: #111111;
  --muted: #5f5f5f;
  --accent: #d6402b;

  --sans: Archivo, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* The page's width, and the narrower one of running text (posts). */
  --page: min(1072px, 100% - 2 * clamp(16px, 5vw, 64px));
  --text-width: 680px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1c1c1c;
    --rule: #f2f2f2;
    --border: #333333;
    --text: #f2f2f2;
    --muted: #a3a3a3;
    --accent: #ff6a52;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  border-top: 10px solid var(--rule);
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}
a {
  color: var(--accent);
}
a:hover {
  text-decoration-thickness: 2px;
}
h1,
h2,
h3 {
  line-height: 1.25;
}
img,
video {
  max-width: 100%;
  height: auto;
}
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}
pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  overflow-x: auto;
}
pre code {
  background: none;
  padding: 0;
}
blockquote {
  margin: 1.5em 0;
  padding-left: 16px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

/* ---------- Top bar and footer ---------- */

.top,
main,
footer {
  width: var(--page);
  margin-inline: auto;
}
.top,
footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.top a,
footer a {
  color: var(--text);
}
.top {
  padding: 24px 0;
  border-bottom: 2px solid var(--rule);
  font-size: 0.875rem;
}
.brand {
  text-decoration: none;
}
.top nav,
footer nav {
  display: flex;
  gap: 24px;
}
footer {
  margin-top: 120px;
  padding: 20px 0 40px;
  border-top: 2px solid var(--rule);
  font-size: 0.8125rem;
}
footer p {
  margin: 0;
}

/* ---------- Home: the name, and beside it the latest posts ---------- */

.home {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 64px;
  padding-top: clamp(40px, 7vw, 88px);
}
.intro {
  flex: 1 1 420px;
  min-width: 0;
}
.intro h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 104px);
  font-weight: 900;
  font-stretch: 112%;
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.intro h1 span {
  display: block;
  color: var(--accent);
}
.intro p {
  margin: 32px 0 0;
  max-width: 22ch;
  font-size: clamp(21px, 2.4vw, 28px);
  font-weight: 500;
  font-stretch: 90%;
  line-height: 1.25;
}
.latest {
  flex: 1 1 380px;
  min-width: 0;
}

/* ---------- Post lists, as a tracklist ---------- */

.list-head {
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--rule);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tracklist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tracklist li {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.track-no {
  flex: 0 0 32px;
  font-weight: 800;
  font-stretch: 110%;
  color: var(--accent);
}
.tracklist li > div {
  flex: 1 1 auto;
  min-width: 0;
}
.tracklist h2,
.tracklist h3 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
}
.tracklist h2 a,
.tracklist h3 a {
  color: var(--text);
  text-decoration: none;
}
.tracklist h2 a:hover,
.tracklist h3 a:hover {
  text-decoration: underline;
}
.tracklist p {
  margin: 4px 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}
.more {
  margin: 20px 0 0;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- The blog's page, the software page, posts and the 404 page ---------- */

.blog,
.software,
.post,
.not-found {
  max-width: var(--text-width);
  padding-top: clamp(40px, 6vw, 72px);
}
.blog h1,
.software h1,
.not-found h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  font-stretch: 112%;
  line-height: 0.95;
  text-transform: uppercase;
}
.section-intro {
  margin: 16px 0 32px;
  color: var(--muted);
}
.post-meta {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.post-head {
  padding-bottom: 24px;
  border-bottom: 2px solid var(--rule);
}
.post-head .post-meta {
  margin: 0;
}
.post-head h1 {
  margin: 0.4em 0 0;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
}
.draft-note {
  display: inline-block;
  margin: 16px 0 0;
  padding: 4px 10px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}
.post-body h2 {
  margin-top: 2em;
  font-weight: 800;
}
