:root {
  --color-text: #222;
  --color-muted: #666;
  --color-bg: #fffdf7;
  --color-border: #ddd;
  --color-code-bg: #f5f5f0;
  --max-width: 37rem;
}

@font-face {
  font-family: "Lato";
  src: local("Lato Regular"), local("Lato-Regular"), url("/fonts/Lato/Lato-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: local("Lato Bold"), local("Lato-Bold"), url("/fonts/Lato/Lato-Bold.ttf") format("truetype");
  font-weight: bold;
  font-display: swap;
}

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

body {
  font-family: Lato, system-ui, sans-serif;
  line-height: 1.5;
  font-size: 1.1rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: inherit;
}

/* Header */
header {
  margin: 2rem 0 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

header h1 a {
  text-decoration: none;
}

nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Article */
article {
  margin-bottom: 3rem;
}

article h2 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

article h2 a {
  text-decoration: none;
}

.meta {
  font-size: 0.875rem;
  color: #999;
  margin-bottom: 2rem;
}

/* Article content - iA/prose inspired */
article .content {
  line-height: 1.75;
  color: var(--color-text);
}

article .content p {
  margin-bottom: 1.25em;
}

article .content a {
  text-decoration: underline;
  text-decoration-color: #ccc;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: text-decoration-color 0.15s ease;
}

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

article .content strong {
  font-weight: 600;
}

article .content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2em 0 0.75em;
  line-height: 1.4;
}

article .content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5em 0 0.5em;
}

article .content ul,
article .content ol {
  margin: 1.25em 0;
  padding-left: 1.625em;
}

article .content li {
  margin-bottom: 0.5em;
}

article .content li::marker {
  color: #999;
}

article .content code {
  font-size: 0.875em;
  font-weight: 600;
  background: var(--color-code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

article .content pre code {
  background: none;
  padding: 0;
  font-weight: normal;
}

article .content figure {
  margin: 2em 0;
}

article .content figcaption {
  font-size: 0.875em;
  color: #666;
  margin-top: 0.75em;
}

article .content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2em auto;
  border-radius: 2px;
}

article .content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 3em 0;
}

/* Notes list */
main > h2 {
  font-size: 1.1rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: 2.5rem;
}

.note {
  display: flex;
  align-items: baseline;
  margin-bottom: 1.4rem;
  line-height: 1.6;
}

.note time {
  color: #999;
  width: 7rem;
  flex-shrink: 0;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.note a {
  text-decoration: none;
  font-weight: normal;
  color: var(--color-text);
  transition: color 0.15s ease;
}

.note a:hover {
  color: #000;
}

.notes-disclaimer {
  margin-top: 3rem;
  font-size: 0.95rem;
  color: #aaa;
  font-style: italic;
}

/* Footer */
footer {
  margin-top: 5rem;
  padding: 2rem 0;
  font-size: 0.95rem;
  color: #aaa;
}

footer p {
  margin: 0;
}

footer a {
  color: #aaa;
  text-decoration: none;
}

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

/* Home page */
.home h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.02em;
}

.home .bio {
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.home .bio a {
  text-decoration: underline;
  text-decoration-color: #ccc;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: text-decoration-color 0.15s ease;
}

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

.home .links {
  margin-bottom: 2.5rem;
  color: var(--color-muted);
}

.home .links a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: #ccc;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s ease;
}

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

.home figure {
  margin: 2rem 0;
}

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

.home figcaption {
  font-size: 0.875rem;
  color: #999;
  margin-top: 2.5rem;
  line-height: 1.5;
}

/* Archives */
main h3 {
  font-size: 1.2rem;
  margin: 2rem 0 1rem;
  color: #444;
}

/* Code */
pre {
  background: var(--color-code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
  font-size: 0.9rem;
}

code {
  font-family: "SF Mono", Menlo, Monaco, monospace;
  font-size: 0.9em;
}

/* Blockquotes */
blockquote {
  border-left: 2px solid #ddd;
  margin: 1.5em 0;
  padding-left: 1.25em;
  color: #555;
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    font-size: 1rem;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    margin: 1.5rem 0 2rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  article h2 {
    font-size: 1.35rem;
  }

  .meta {
    margin-bottom: 1.5rem;
  }

  article .content {
    line-height: 1.7;
  }

  .note {
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
  }

  .note time {
    width: auto;
  }
}
