:root {
  color-scheme: light;
  --bg: #f3e5da;
  --paper: #fffaf3;
  --ink: #26231f;
  --muted: #6e655c;
  --faint: #968a7d;
  --line: #e3d2c2;
  --accent: #9b5d43;
  --accent-soft: #f8ece3;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--sans);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.site-header,
#app {
  width: min(760px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 28px 0 8px;
}

nav {
  display: flex;
  gap: 0.4rem;
  border: 1px solid rgba(155, 93, 67, 0.14);
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.66);
  color: var(--muted);
  font-size: 0.94rem;
  padding: 0.25rem;
}

nav a {
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible,
nav a[aria-current="page"],
.text-link:hover,
.text-link:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}

#app {
  padding: 38px 0 76px;
  outline: none;
}

.intro {
  margin-bottom: 34px;
}

.eyebrow,
.meta {
  display: block;
  margin: 0 0 0.75rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 1.15rem;
  font-family: var(--serif);
  font-size: clamp(3rem, 9vw, 5.4rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.blog-title {
  max-width: none;
  margin-bottom: 0.8rem;
  font-family: var(--sans);
  font-size: clamp(1.7rem, 4vw, 2.25rem);
  font-weight: 720;
  line-height: 1.2;
}

.intro p,
.about p,
.article-dek {
  max-width: 660px;
  color: #514a42;
  font-family: var(--serif);
  font-size: clamp(1.13rem, 2vw, 1.3rem);
  line-height: 1.72;
}

.archive > h2 {
  margin: 0 0 1rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: lowercase;
}

.archive {
  display: grid;
  gap: 2rem;
}

.year-group {
  scroll-margin-top: 1rem;
}

.year-group > h3 {
  margin: 0 0 0.55rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
}

.note-list {
  display: grid;
  gap: 0;
}

.note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  padding: 10px 0;
  text-decoration: none;
}

.note h4 {
  margin: 0 0 0.32rem;
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: 0;
}

.topic-line {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.note time {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
}

.note:hover h4,
.note:focus-visible h4 {
  color: var(--accent);
}

.note:hover,
.note:focus-visible {
  background: transparent;
  outline: none;
}

.article {
  max-width: 720px;
}

.back-link,
.text-link {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.back-link {
  display: inline-flex;
  margin-bottom: 48px;
}

.article header {
  margin-bottom: 42px;
}

.article h1 {
  max-width: 720px;
  margin-bottom: 1rem;
  font-size: clamp(2.7rem, 8vw, 4.8rem);
}

.article-dek {
  margin-bottom: 1rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.4rem;
}

.tag {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.article-body {
  color: #302b26;
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.86;
}

.article-body p {
  margin-bottom: 1.45rem;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 2.2rem 0 0.8rem;
  font-family: var(--sans);
  line-height: 1.3;
}

.article-body h2 {
  font-size: 1.45rem;
}

.article-body h3 {
  font-size: 1.22rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.45rem;
  padding-left: 1.35rem;
}

.article-body li {
  margin-bottom: 0.45rem;
}

.article-body code {
  border-radius: 4px;
  background: rgba(255, 250, 243, 0.66);
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 0.05rem 0.24rem;
}

.article-body pre {
  overflow-x: auto;
  margin: 1.8rem 0;
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.66);
  padding: 1rem;
}

.article-body pre code {
  background: transparent;
  padding: 0;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.8rem 0;
  border-radius: 8px;
}

.article-body blockquote {
  margin: 2.3rem 0;
  border-left: 2px solid rgba(155, 93, 67, 0.22);
  color: #554b43;
  font-size: 1.26rem;
  line-height: 1.62;
  padding-left: 1rem;
}

.about {
  max-width: 680px;
}

.about-header {
  margin-bottom: 1.45rem;
}

.about h1 {
  max-width: 680px;
  margin-bottom: 0;
  font-size: clamp(2.8rem, 8vw, 4.9rem);
}

.about-copy {
  max-width: 620px;
}

.about p {
  margin-bottom: 1.4rem;
}

.about .text-link {
  color: var(--accent);
  font-size: inherit;
}

.not-found {
  max-width: 560px;
}

.empty-state {
  max-width: 34rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.7;
}

@media (max-width: 620px) {
  .site-header,
  #app {
    width: min(100% - 28px, 760px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 22px;
  }

  #app {
    padding-top: 42px;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .note {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .note time {
    order: -1;
  }

}
