:root {
  --bg: #f3f5f7;
  --ink: #12151a;
  --muted: #5c6570;
  --line: #d7dde5;
  --line-strong: #b7c1cc;
  --surface: #ffffff;
  --teal: #165a4a;
  --teal-deep: #0d3f34;
  --teal-soft: #e8f3ef;
  --code: #e9edf1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  color-scheme: light;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, var(--teal) 0 5.5rem, var(--teal-deep) 5.5rem 8.5rem, transparent 8.5rem) top / 100% 3px no-repeat,
    radial-gradient(720px 420px at 92% 0%, rgba(22, 90, 74, 0.07), transparent 55%),
    var(--bg);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--teal-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--teal);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(243, 245, 247, 0.94);
  backdrop-filter: blur(12px);
}

.mark {
  color: var(--ink);
  font-family: Newsreader, Georgia, serif;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.mark span {
  color: var(--teal);
}

.topnav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.15rem;
  font-size: 0.86rem;
  font-weight: 500;
}

.topnav nav a {
  color: var(--muted);
  text-decoration: none;
}

.topnav nav a[aria-current="page"],
.topnav nav a:hover {
  color: var(--teal-deep);
}

main,
.site-footer {
  width: min(calc(100% - 2.5rem), 52rem);
  margin-inline: auto;
}

main {
  padding: clamp(3.25rem, 8vw, 6.5rem) 0 5rem;
}

.post-main {
  width: min(calc(100% - 2.5rem), 65ch);
}

.kicker,
.meta,
.byline {
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.77rem;
  letter-spacing: 0.015em;
}

.kicker {
  margin-bottom: 0.85rem;
  color: var(--teal-deep);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 650;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 46rem;
  font-size: clamp(2.65rem, 7vw, 4.65rem);
  line-height: 0.98;
}

.post-main h1 {
  max-width: 15ch;
}

.dek {
  max-width: 42rem;
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.24rem);
  line-height: 1.55;
}

.index-head {
  padding-bottom: clamp(2.5rem, 6vw, 4.25rem);
}

.index-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.post-list {
  border-top: 1px solid var(--line-strong);
}

.post-row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem 1.5rem;
  padding: 1.65rem 0 1.8rem;
  border-bottom: 1px solid var(--line);
}

.post-row h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.45rem, 3vw, 1.8rem);
  line-height: 1.15;
}

.post-row h2 a {
  color: var(--ink);
  text-decoration: none;
}

.post-row h2 a:hover {
  color: var(--teal-deep);
}

.post-row .summary {
  color: var(--muted);
  font-size: 0.98rem;
}

.article-head {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line-strong);
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin-top: 1.4rem;
}

.byline a {
  color: inherit;
}

.prose {
  margin-top: 2.5rem;
}

.prose h2 {
  margin: 2.8rem 0 0.75rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.2;
}

.prose h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.25rem;
  line-height: 1.25;
}

.prose p,
.prose ul,
.prose ol {
  margin-bottom: 1.2rem;
  font-size: 1.07rem;
  line-height: 1.72;
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

code {
  padding: 0.08em 0.3em;
  border-radius: 3px;
  background: var(--code);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.86em;
}

pre {
  margin: 1.7rem 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  background: #e9edf1;
  color: var(--ink);
  line-height: 1.55;
}

pre code {
  padding: 0;
  background: transparent;
  font-size: 0.82rem;
}

.note {
  margin: 2rem 0;
  padding: 1.05rem 1.2rem;
  border-left: 3px solid var(--teal);
  background: var(--teal-soft);
}

.note p:last-child {
  margin-bottom: 0;
}

.article-end {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-strong);
}

.article-end h2 {
  margin: 0 0 0.65rem;
  font-size: 1.25rem;
}

.article-end p {
  color: var(--muted);
}

.related {
  margin-top: 2.2rem;
}

.related h2 {
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
}

.related a {
  display: block;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.related a:hover {
  color: var(--teal-deep);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.4rem 0 2.4rem;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer a {
  color: var(--muted);
}

@media (max-width: 640px) {
  .topnav {
    align-items: flex-start;
  }

  .topnav nav {
    width: 100%;
  }

  main {
    padding-top: 3rem;
  }

  .post-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .site-footer {
    display: grid;
  }
}
