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

:root {
  --bg: #fafaf8;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e5e0;
  --max-width: 640px;
  --nav-active-underline: #d4611a;
  --nav-hover-underline: #d4611a;
}

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

body {
  margin: 0;
  padding: 2rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font-family: Optima, Candara, Cantarell, sans-serif;
  line-height: 1.65;
  max-width: var(--max-width);
  margin-inline: auto;
}

/* Header */

header {
  padding-block: 0.5rem 3rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

nav a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}
body.home nav a[href="/"],
body.blog nav a[href="/blog/"],
body.photos nav a[href="/photos/"],
body.tools nav a[href="/tools/"] {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--nav-active-underline);
  text-decoration-thickness: 2px;
}

nav a:hover {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--nav-hover-underline);
  text-decoration-thickness: 2px;
}

.nav-avatar {
  display: flex;
  flex-shrink: 0;
  margin-right: 0.25rem;
}

.nav-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Links */

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

/* Typography */

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

h2 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.5rem 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

/* Intro */

.intro {
  margin-bottom: 3rem;
}

.intro p {
  font-size: 1.05rem;
  max-width: 54ch;
}

.intro p:first-of-type,
.subtitle {
  margin-top: -0.75rem;
  color: var(--muted);
}

/* Post list */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.45;
}

.post-list li:first-child {
  border-top: 1px solid var(--border);
}

.post-list a {
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
}

.post-list a:hover {
  color: var(--accent);
}

.post-list .excerpt {
  color: var(--muted);
  font-size: 0.9rem;
}

.post-list .excerpt::before {
  content: "—";
  margin-inline: 0.3em;
}

/* Single post */

article {
  max-width: 60ch;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.25rem 0 2.5rem;
}

article p,
article li {
  line-height: 1.75;
}

article ul,
article ol {
  padding-left: 1.4rem;
  margin: 0 0 1rem;
}

article blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
  font-style: italic;
}

article code {
  font-size: 0.875em;
  background: var(--border);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-family: "SF Mono", ui-monospace, monospace;
}

article pre {
  background: var(--border);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

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

.back-link {
  display: inline-block;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--fg);
}

/* Footer */

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--fg);
}

.footer-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-identity img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Photo wall */

.photo-wall {
  columns: 2;
  column-gap: 0.75rem;
}

.photo-wall a {
  display: block;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.photo-wall img {
  width: 100%;
  display: block;
  transition: opacity 0.15s ease;
}

.photo-wall a:hover img {
  opacity: 0.85;
}

@media (min-width: 480px) {
  .photo-wall {
    columns: 2;
  }
}
