:root {
  --bg: #F4F5F7;
  --text: #2C2926;
  --muted: #666A71;
  --rule: #DCDEE3;
  --link: #5E81AC;
  --link-hover: #4C6D94;
  --inline-code-bg: #E8E9ED;
  --nord0: #2E3440;
  --nord6: #ECEFF4;
  --nord9: #81A1C1;
}

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

body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  max-width: 62ch;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3rem;
  -webkit-font-smoothing: antialiased;
}

/* --- Header (post pages) --- */

.site-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.site-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header-name {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}

.site-header-name:hover {
  color: var(--link);
}

.site-header-tagline {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.1rem;
}

.site-header-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.site-header-links a {
  text-decoration: none;
  display: flex;
}

.site-header-links a:hover .social-icon {
  opacity: 0.8;
}

/* --- Headings --- */

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 2rem 0 0.5rem;
}

/* --- Links --- */

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

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

/* --- Body text --- */

p {
  margin: 1.25em 0;
}

strong {
  font-weight: 600;
}

ul, ol {
  margin: 1.25em 0;
  padding-left: 1.25em;
}

li {
  margin: 0.3em 0;
}

li > ul, li > ol {
  margin: 0.25em 0;
}

/* --- Code --- */

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

p code, li code, td code {
  background: var(--inline-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.75em 0;
  line-height: 1.25;
  font-size: 1rem;
}

/* --- Blockquotes --- */

blockquote {
  border-left: 2px solid var(--muted);
  padding-left: 1.25rem;
  margin: 1.5em 0;
  color: var(--muted);
}

blockquote p {
  margin: 0.5em 0;
}

/* --- Horizontal rules --- */

hr {
  border: none;
  height: 1px;
  background: var(--rule);
  margin: 2.5rem 0;
}

/* --- Tables --- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

th {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- Images --- */

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5em 0;
}

/* --- Social icons --- */

.social-icon {
  width: 20px;
  height: 20px;
  opacity: 0.4;
  transition: opacity 0.2s;
  margin: 0;
  border-radius: 0;
}

/* --- About (index) --- */

.about {
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.about-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.about-name {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.about-tagline {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.about-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.about-links a {
  text-decoration: none;
  display: flex;
}

.about-links a:hover .social-icon {
  opacity: 0.8;
}

/* --- Post page --- */

.post-date {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
  margin-bottom: 2.5rem;
}

/* --- Post list (index) --- */

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

.post-list li {
  margin-bottom: 1.75rem;
}

.post-list a {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--text);
  text-decoration: none;
  display: block;
}

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

.post-list time {
  color: var(--muted);
  font-size: 0.85rem;
  display: block;
  margin-top: 0.15rem;
}

/* --- Responsive --- */

@media (max-width: 600px) {
  body {
    font-size: 1.0625rem;
    padding: 2.5rem 1.25rem 2rem;
  }

  .site-header {
    margin-bottom: 2rem;
  }

  h1 {
    font-size: 1.65rem;
  }

  .about-header,
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  pre {
    padding: 1rem;
    font-size: 0.78rem;
  }
}
