/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Variables */
:root {
  --text: #171717;
  --text-secondary: #525252;
  --text-muted: #a3a3a3;
  --background: #ffffff;
  --accent: #171717;
  --accent-hover: #404040;
  --border: #e5e5e5;
  --hover-bg: #fafafa;
  --max-width: 600px;
  --font-size: 16px;
  --line-height: 1.75;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #fafafa;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --background: #0a0a0a;
    --accent: #fafafa;
    --accent-hover: #d4d4d4;
    --border: #262626;
    --hover-bg: #171717;
  }
}

/* Base */
html {
  font-size: var(--font-size);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    sans-serif;
  line-height: var(--line-height);
  color: var(--text);
  background-color: var(--background);
  padding: 4rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--background);
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Typography */
h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 2rem;
}

h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  text-transform: lowercase;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

/* Links */
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-muted);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--text);
}

a:focus {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Article list */
.article-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.article-list li {
  margin: 0;
}

.article-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin: 0 -1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.article-list a:hover {
  background-color: var(--hover-bg);
}

.article-list a:focus {
  outline-offset: -2px;
}

.article-title {
  font-weight: 500;
}

.article-date {
  color: var(--text-muted);
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* Nav */
nav {
  margin-top: 4rem;
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Article */
article {
  margin-top: 1rem;
}

article header {
  margin-bottom: 3rem;
}

article header h1 {
  margin-bottom: 0.5rem;
}

article header time {
  color: var(--text-muted);
  font-size: 0.875rem;
}

article p {
  color: var(--text);
}

article a {
  color: var(--text);
}

/* Code */
code {
  font-family:
    'SF Mono',
    Menlo,
    Monaco,
    'Courier New',
    monospace;
  font-size: 0.875em;
  background: var(--hover-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

pre {
  background: var(--hover-bg);
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

pre code {
  background: none;
  padding: 0;
}

/* Blockquote */
blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-style: italic;
}

/* Lists in articles */
article ul,
article ol {
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
  color: var(--text);
}

article li {
  margin-bottom: 0.5rem;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* Selection */
::selection {
  background-color: var(--text);
  color: var(--background);
}
