:root {
  color-scheme: dark;

  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #21262d;
  --border: #30363d;
  --text: #c9d1d9;
  --text-strong: #e6edf3;
  --text-muted: #8b949e;
  --link: #58a6ff;
  --link-hover: #79c0ff;
  --accent: #3fb950;

  /* Syntax highlighting (Prism token classes emitted by Moon) */
  --code-comment: #8b949e;
  --code-keyword: #ff7b72;
  --code-string: #a5d6ff;
  --code-type: #ffa657;
  --code-function: #d2a8ff;
  --code-number: #79c0ff;
  --code-attribute: #7ee787;
  --code-punctuation: #c9d1d9;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-strong);
  text-decoration: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 20px;
}

.nav-links a:hover {
  color: var(--text-strong);
}

.nav-links {
  display: flex;
  align-items: center;
}

/* "Work with me" mail button: an outlined pill in the accent colour. */
.nav-links a.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  white-space: nowrap;
}

.nav-links a.nav-cta:hover {
  background: var(--accent);
  color: var(--bg);
}

.nav-cta svg {
  width: 15px;
  height: 15px;
}

/* On phones the links move to their own row under the site title. */
@media (max-width: 480px) {
  header nav {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .site-title {
    white-space: nowrap;
  }

  .nav-links {
    width: 100%;
    gap: 12px;
  }

  .nav-links a {
    margin-left: 6px;
  }

  .nav-links a:first-child {
    margin-left: 0;
  }

  .nav-links a.nav-cta {
    margin-left: auto;
  }
}

main {
  min-height: 60vh;
}

h1, h2, h3 {
  color: var(--text-strong);
}

h1 {
  font-size: 2rem;
  margin-bottom: 20px;
}

h2 {
  font-size: 1.4rem;
  margin: 30px 0 10px;
}

h3 {
  font-size: 1.15rem;
  margin: 24px 0 8px;
}

p {
  margin-bottom: 16px;
}

strong {
  color: var(--text-strong);
}

a {
  color: var(--link);
}

a:hover {
  color: var(--link-hover);
}

article {
  margin-bottom: 40px;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-left: 0;
}

.tags li a {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}

.tags li a:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}

.article-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.article-card h2 {
  margin: 0 0 8px;
}

.article-card h2 a {
  color: var(--text-strong);
  text-decoration: none;
}

.article-card h2 a:hover {
  color: var(--link);
}

.article-card p {
  color: var(--text-muted);
  margin: 0;
}

footer {
  margin-top: 60px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

ol, ul {
  margin-bottom: 16px;
  padding-left: 24px;
}

li {
  margin-bottom: 4px;
}

code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
  line-height: 1.45;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

.token.comment,
.token.prolog,
.token.doctype { color: var(--code-comment); font-style: italic; }
.token.keyword,
.token.important,
.token.atrule { color: var(--code-keyword); }
.token.string,
.token.string-literal,
.token.char,
.token.url { color: var(--code-string); }
.token.class-name,
.token.builtin,
.token.constant { color: var(--code-type); }
.token.function,
.token.function-definition { color: var(--code-function); }
.token.number,
.token.boolean { color: var(--code-number); }
.token.attribute,
.token.directive,
.token.key,
.token.property { color: var(--code-attribute); }
.token.punctuation,
.token.operator { color: var(--code-punctuation); }

img,
video {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.95em;
}

th, td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface);
  color: var(--text-strong);
}

::selection {
  background: rgba(88, 166, 255, 0.35);
}

/* Home page hero: picture on the left, greeting centred beside it. */
.hero {
  display: flex;
  align-items: center;
  gap: 36px;
  margin: 8px 0 40px;
}

.hero img {
  flex: 0 0 380px;
  width: 380px;
  border-radius: 16px;
}

.hero h1 {
  font-size: 2.4rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.hero p {
  font-size: 1.1rem;
  line-height: 1.7;
}

.social {
  display: flex;
  gap: 18px;
  margin-top: 20px;
}

.social a {
  color: var(--text-strong);
}

.social a:hover {
  color: var(--link-hover);
}

.social svg {
  width: 28px;
  height: 28px;
  display: block;
}

@media (max-width: 700px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .hero img {
    flex-basis: auto;
    width: 100%;
  }

  .hero h1 {
    font-size: 2rem;
  }
}
