* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0 auto;
  max-width: 76rem;
  padding: 4.5rem clamp(1.5rem, 6vw, 5rem);
  color: var(--text);
  background: var(--background);
  font: 1.125rem/1.55 var(--sans);
}

a {
  color: var(--accent);
  text-underline-offset: .2em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  top: .5rem;
  translate: 0 -200%;
  background: var(--background);
  padding: .5rem;
}

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

.site-header, .site-nav, .tag-links, .pagination, .post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .55rem 1rem;
}

.site-header {
  justify-content: space-between;
  margin-bottom: 3.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.site-name {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.045em;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}

.site-name:is(:hover, :focus-visible) { border-bottom-color: var(--accent); }

.site-nav { font-size: 1rem; }
.site-nav a:not([aria-current]) { text-decoration: none; }
button.theme-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  place-items: center;
  width: 3.75rem;
  min-height: 2rem;
  padding: .15rem;
  border-radius: 2rem;
  color: var(--accent);
}

.theme-switch::before {
  content: "";
  position: absolute;
  inset: .15rem auto .15rem .15rem;
  width: calc(50% - .15rem);
  border-radius: 2rem;
  background: var(--wash);
}

.theme-switch[aria-checked="true"]::before { translate: 100%; }
.theme-switch svg {
  position: relative;
  width: 1rem;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button {
  font: inherit;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--muted);
  border-radius: .25rem;
  padding: .2em .55em;
}

button, select, summary { cursor: pointer; }

h1, h2, h3 { line-height: 1.15; }
h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); margin: 0 0 .75rem; letter-spacing: -.035em; }
h2 { font-size: 1.55rem; margin: 0 0 .35rem; }

.listing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 13rem);
  grid-template-rows: max-content 1fr;
  grid-template-areas: "heading archive" "posts archive";
  gap: 1.65rem clamp(1.75rem, 6vw, 5rem);
}

.listing-heading { grid-area: heading; }
.post-list { grid-area: posts; min-width: 0; max-width: 64ch; }
.tag-links, .post-meta { font-size: .95rem; }
.tag-links a {
  border-bottom: 1px dotted transparent;
  text-decoration: none;
}
.tag-links a:is(:hover, :focus-visible) { border-bottom-color: currentColor; }
.tag-links a[aria-current] { font-weight: 700; border-bottom-style: solid; border-bottom-color: currentColor; }
.tag-links .all-tags {
  background: var(--wash);
  border-radius: .2rem;
  padding: .1em .55em;
  font-weight: 700;
}
.tag-highlight { color: var(--accent); }
.post-meta, time { color: var(--muted); }

.post-entry { padding: 1.4rem 0; border-top: 1px solid var(--rule); }
.post-entry h2 a { color: var(--text); text-decoration: none; }
.post-entry h2 a:hover { color: var(--accent); text-decoration: underline; }
.post-entry p { margin: .45rem 0 0; }
.pagination {
  align-items: center;
  justify-content: center;
  gap: .25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.page-box {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  min-height: 2rem;
  padding-inline: .2rem;
  border: 1px solid var(--rule);
  border-radius: .15rem;
  text-decoration: none;
}
a.page-box:hover, .page-box[aria-current] { background: var(--wash); border-color: var(--accent); }
.page-box[aria-current] { color: var(--accent); font-weight: 700; }
.page-unavailable, .page-gap { color: var(--muted); }

@media (max-width: 375px) {
  .pagination { gap: .125rem; }
  .page-box { min-width: 1.5rem; padding-inline: .125rem; }
}

.archive {
  grid-area: archive;
  align-self: start;
  border-inline-start: 1px solid var(--rule);
  padding-inline-start: 1.25rem;
  font-size: 1rem;
}

.archive summary { font-weight: 700; }
.archive-year { margin-top: .65rem; }
.archive ul { margin: .25rem 0 0; padding: 0; list-style: none; }
.archive li a {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .25rem .5rem;
  border-inline-start: 3px solid transparent;
  text-decoration: none;
}
.archive li a:hover { text-decoration: underline; }
.archive li a[aria-current] { border-color: var(--accent); background: var(--wash); font-weight: 700; }
.archive li span { color: var(--muted); font-variant-numeric: tabular-nums; }
.archive-reset { display: inline-block; margin-top: .5rem; }

.reading { max-width: 41rem; margin-inline: auto; }
.reading nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.preview-notice {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.25rem;
  margin-bottom: 1.5rem;
  padding: .75rem 1rem;
  border-inline-start: 2px solid var(--accent);
  background: var(--wash);
  font-size: .95rem;
}

.preview-notice p { margin: 0; }
.preview-notice strong + p { color: var(--muted); }
.preview-notice time { color: inherit; }
.preview-notice nav { align-items: center; }

.prose { font: 1.1875rem/1.75 var(--serif); overflow-wrap: anywhere; }
.prose :is(h2, h3, h4) { font-family: var(--sans); margin-top: 1.8em; }
pre, code { font-family: ui-monospace, monospace; font-size: .85em; }
code { background: var(--wash); padding: .1em .25em; }
pre { overflow-x: auto; background: var(--wash); padding: 1rem; overflow-wrap: normal; }
pre code { padding: 0; font-size: 1em; }
img { max-width: 100%; height: auto; }
.reactions { margin-block-start: 2rem; }
.reaction-button {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--accent);
}
.reaction-button[aria-pressed="true"] { background: var(--wash); }
.reaction-button[aria-pressed="true"] svg { fill: currentColor; }

@media (max-width: 720px) {
  body { padding-block: 2rem; }
  .site-header { margin-bottom: 2rem; }
  .listing {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "heading" "archive" "posts";
    gap: 1rem;
  }
  .archive {
    border-inline-start: 0;
    border-block: 1px solid var(--rule);
    padding: .55rem 0;
  }
}
