:root {
  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas,
    "Liberation Mono", monospace;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #666666;
  --accent: #1a56db;
  --border: #e2e2e2;
  --code-bg: #f5f5f5;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --fg: #e8e8e8;
    --muted: #999999;
    --accent: #7aa2ff;
    --border: #2a2a2a;
    --code-bg: #1c1c1c;
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Layout: single centred column */
.site-header,
main,
.site-footer {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

main {
  flex: 1 0 auto;
  padding-block: 2rem;
}

/* Header + nav */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--border);
}

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

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--fg);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Footer */
.site-footer {
  flex-shrink: 0;
  padding-block: 1.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0;
}

/* Typography */
h1,
h2,
h3 {
  line-height: 1.3;
  font-weight: 700;
}

h1 {
  font-size: 1.6rem;
  margin-block: 0 1.25rem;
}

h2 {
  font-size: 1.25rem;
  margin-block: 2rem 0.75rem;
}

h3 {
  font-size: 1.05rem;
  margin-block: 1.75rem 0.5rem;
}

p,
ul,
ol {
  margin-block: 0 1.25rem;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: 2rem;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

/* Blog list */
.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.post-list time {
  color: var(--muted);
  font-size: 0.85rem;
  min-width: 8.5rem;
}

/* Post meta */
.post-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: -0.5rem;
}

.post-back {
  margin-top: 2.5rem;
}

/* App Store badge on the products page */
.appstore-badge {
  display: inline-block;
  width: 165px;
  height: 40px;
  background: url("/assets/images/appstore.svg") no-repeat center / contain;
}

.appstore-badge.ios {
  width: 117px;
  background-image: url("/assets/images/appstore-ios.png");
}
