:root {
  color-scheme: dark;
  --bg: #111716;
  --surface: #1a2321;
  --ink: #b6ccdf;
  --muted: #91a9bd;
  --accent: #97bfe1;
  --line: #33413b;
  --width: 720px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  max-width: 1120px;
  margin: auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 220px minmax(0, var(--width));
  gap: 80px;
}

.site-header {
  padding-top: 78px;
  align-self: start;
  position: sticky;
  top: 0;
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.05em;
}

.brand .profile-avatar {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 20px;
}

.description {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 20px 0 28px;
}

.site-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
}

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

.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}

.site-main {
  min-width: 0;
  padding-top: 78px;
}

.eyebrow,
.post-meta,
.site-footer,
.pagination,
.categories {
  font-size: .78rem;
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  margin: 0 0 40px;
}

.post {
  padding-bottom: 42px;
  margin-bottom: 42px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.post-meta a {
  color: var(--muted);
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  letter-spacing: -.035em;
}

h1 {
  font-size: 2.35rem;
  margin: 0 0 30px;
}

h2 {
  font-size: 1.7rem;
  margin: 0 0 22px;
}

h2 a {
  color: var(--ink);
  text-decoration: none;
}

h3 {
  font-size: 1.25rem;
}

.e-content {
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1.8;
}

.e-content > :first-child {
  margin-top: 0;
}

.e-content > :last-child {
  margin-bottom: 0;
}

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

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

audio {
  width: 100%;
}

figure {
  margin: 1.5em 0;
}

figcaption {
  font: .78rem/1.6 system-ui;
  color: var(--muted);
  margin-top: 12px;
}

.e-content iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
  aspect-ratio: 16/9;
  height: auto;
  border-radius: 8px;
}

.e-content iframe:not([src*="youtube"]):not([src*="vimeo"]) {
  aspect-ratio: auto;
  min-height: 180px;
}

.video-embed {
  aspect-ratio: 16/9;
  background: #080d0b;
  border-radius: 8px;
  overflow: hidden;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
}

.photo-grid,
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 12px;
}

.photo-grid img,
.photos-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.categories a {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2px 10px;
  border-radius: 20px;
  text-decoration: none;
}

pre {
  overflow: auto;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .8rem;
}

code {
  font-family: ui-monospace, monospace;
}

p code {
  font-size: .8em;
  background: var(--surface);
  padding: 2px 5px;
  border-radius: 3px;
}

table {
  display: block;
  overflow: auto;
  border-collapse: collapse;
  width: 100%;
  font-size: .9rem;
}

th,
td {
  text-align: left;
  padding: 10px;
}

hr {
  border: 0;
  margin: 32px 0;
}

.footnotes {
  font-size: .85em;
  color: var(--muted);
}

sup a {
  display: inline-block;
  padding: 0 .2em;
  line-height: 1.1;
  font-family: system-ui;
  font-size: .75em;
  font-weight: 700;
}

.footnotes li:target {
  background: var(--surface);
  outline: 1px solid var(--accent);
  border-radius: 4px;
}

.footnotes li {
  padding: 4px;
  scroll-margin-top: 2rem;
}

.footnote-preview {
  position: fixed;
  inset: auto 20px 20px auto;
  z-index: 20;
  width: min(420px, calc(100vw - 40px));
  max-height: 40vh;
  overflow: auto;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 14px 60px #0008;
  font-size: .85rem;
}

.footnote-preview[hidden] {
  display: none;
}

.footnote-preview button {
  float: right;
  margin: 0 0 10px 16px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  padding: 2px 10px;
}

.pagination {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0;
}

.site-footer {
  padding: 28px 0 45px;
  margin-top: 50px;
}

.site-footer p {
  margin: 5px 0;
}

.skip-link {
  position: absolute;
  left: 20px;
  top: -100px;
  z-index: 50;
  background: var(--bg);
  padding: 10px;
}

.skip-link:focus {
  top: 10px;
}

.archive-year {
  margin-top: 36px;
}

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

.archive-list li {
  padding: 12px 0;
}

.archive-list time {
  display: block;
  color: var(--muted);
  font-size: .75rem;
}

.empty {
  color: var(--muted);
}

#conversation {
  margin-top: 35px;
}

#conversation img {
  display: inline-block;
}

.reading-time {
  color: var(--muted);
}

@media (max-width: 850px) {
  .shell {
    display: block;
    max-width: 760px;
    padding: 0 24px;
  }

  .site-header {
    position: static;
    padding-top: 35px;
    padding-bottom: 25px;
  }

  .brand .profile-avatar {
    display: inline-block;
    width: 48px;
    height: 48px;
    margin: 0 12px 0 0;
    vertical-align: middle;
  }

  .description {
    margin: 12px 0 18px;
    max-width: 38ch;
  }

  .site-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 22px;
  }

  .site-main {
    padding-top: 35px;
  }

  .eyebrow {
    margin-bottom: 28px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  :root {
    color-scheme: light;
    --bg: white;
    --ink: black;
    --muted: #333;
    --accent: #174c35;
    --line: #ccc;
  }

  .shell {
    display: block;
    padding: 0;
  }

  .site-header,
  .site-footer,
  .pagination,
  .footnote-preview {
    display: none;
  }

  .site-main {
    padding: 0;
  }

  .post {
    break-inside: avoid;
  }

  a {
    color: inherit;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
