:root {
  color-scheme: light;
  --canvas: #f7f7f4;
  --ink: #111214;
  --muted: #656b74;
  --line: #d9dce1;
  --accent: #1f52d6;
  --accent-soft: #e5ebfb;
  --code-bg: #ecece8;
  --selection: #cbd7f8;
  --shell: 1332px;
  --gutter: clamp(24px, 5vw, 72px);
  --font-sans: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #101113;
  --ink: #f2f2ee;
  --muted: #9da3ac;
  --line: #34373d;
  --accent: #7da0ff;
  --accent-soft: #1b2b58;
  --code-bg: #191b1f;
  --selection: #31477f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--canvas);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--selection);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

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

.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;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 9px 13px;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--canvas);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(calc(100% - (2 * var(--gutter))), var(--shell));
  margin-inline: auto;
}

.site {
  min-height: 100vh;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 102px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  width: max-content;
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.7vw, 42px);
}

.site-nav > a {
  position: relative;
  color: var(--muted);
  font-size: 1rem;
  text-decoration: none;
  transition: color 160ms ease-out;
}

.site-nav > a::after {
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  height: 1px;
  content: "";
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease-out;
}

.site-nav > a:hover,
.site-nav > a.is-active {
  color: var(--ink);
}

.site-nav > a:hover::after,
.site-nav > a.is-active::after {
  transform: scaleX(1);
}

.theme-toggle {
  display: inline-grid;
  width: 30px;
  height: 30px;
  padding: 5px;
  cursor: pointer;
  place-items: center;
  background: transparent;
}

.theme-toggle__mark {
  display: block;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  transition:
    background-color 160ms ease-out,
    border-color 160ms ease-out;
}

html[data-theme="dark"] .theme-toggle__mark {
  border-color: var(--accent);
  background: var(--accent);
}

.home-intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  min-height: clamp(365px, 40vw, 495px);
  padding-block: clamp(76px, 8.5vw, 126px) 72px;
  align-content: start;
}

.home-intro h1 {
  grid-column: 2 / span 5;
  max-width: 620px;
  margin: 0;
  font-size: clamp(3.2rem, 5vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.99;
}

.home-intro p {
  grid-column: 8 / span 4;
  align-self: end;
  max-width: 390px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.writing {
  margin-bottom: 128px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.section-heading a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.section-heading a:hover {
  color: var(--accent);
}

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

.post-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 104px;
  border-bottom: 1px solid var(--line);
  animation: rise 280ms ease-out both;
  animation-delay: calc(var(--row, 0) * 45ms);
}

.post-row a {
  width: max-content;
  max-width: 100%;
  font-size: clamp(1.45rem, 2.25vw, 2.05rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
  text-decoration: none;
  transition: color 160ms ease-out;
}

.post-row time {
  color: var(--muted);
  font-size: 0.98rem;
  white-space: nowrap;
}

.post-row__content {
  min-width: 0;
}

.post-row__content p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.post-arrow {
  color: var(--accent);
  font-size: 2.35rem;
  font-weight: 300;
  line-height: 1;
  transition: transform 160ms ease-out;
}

.post-row:has(a:hover) .post-arrow {
  transform: translateX(4px);
}

.post-row a:hover {
  color: var(--accent);
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-block: 34px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 24px;
}

.site-footer a {
  text-decoration: none;
}

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

.page-header {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  padding-block: clamp(80px, 9vw, 132px) clamp(64px, 7vw, 98px);
  border-bottom: 1px solid var(--line);
}

.page-header .eyebrow {
  grid-column: 1 / span 2;
  padding-top: 10px;
}

.page-header h1 {
  grid-column: 3 / span 7;
  margin: 0;
  font-size: clamp(3rem, 5.6vw, 5.8rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.page-header p {
  grid-column: 10 / span 3;
  align-self: end;
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.7;
}

.archive {
  padding-block: 56px 126px;
}

.archive-year {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 24px;
}

.archive-year + .archive-year {
  margin-top: 78px;
}

.archive-year h2 {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.archive-year .post-list {
  border-top: 1px solid var(--line);
}

.archive-year .post-row {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  min-height: 88px;
}

.archive-year .post-row a {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.article-header {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  padding-block: clamp(78px, 9vw, 134px) 62px;
  border-bottom: 1px solid var(--line);
}

.article-header__meta {
  grid-column: 1 / span 2;
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.9;
  text-transform: uppercase;
}

.article-header__meta time,
.article-header__meta span {
  display: block;
}

.article-header h1 {
  grid-column: 3 / span 8;
  max-width: 940px;
  margin: 0;
  font-size: clamp(3.15rem, 6.2vw, 6.5rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.article-header__dek {
  grid-column: 3 / span 6;
  max-width: 680px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.65;
}

.prose {
  width: min(100%, 760px);
  margin: 0 auto;
  padding-block: clamp(64px, 7vw, 104px) 128px;
  font-size: clamp(1.05rem, 1.15vw, 1.16rem);
  line-height: 1.82;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table,
.prose figure {
  margin-block: 1.55em;
}

.prose h2,
.prose h3 {
  margin-block: 2.2em 0.75em;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.prose h2 {
  font-size: clamp(2rem, 3vw, 2.65rem);
}

.prose h3 {
  font-size: clamp(1.45rem, 2vw, 1.85rem);
}

.prose a {
  color: var(--accent);
}

.prose blockquote {
  padding: 0.1em 0 0.1em 1.25em;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 1.15em;
}

.prose blockquote p {
  margin: 0;
}

.prose code,
.search-count {
  font-family: var(--font-mono);
}

.prose :not(pre) > code {
  padding: 0.14em 0.34em;
  background: var(--code-bg);
  font-size: 0.88em;
}

.prose pre {
  overflow-x: auto;
  padding: 24px 26px;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  tab-size: 2;
}

.prose pre code {
  padding: 0;
  background: transparent;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.prose th,
.prose td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.prose th {
  font-weight: 600;
}

.prose hr {
  width: 80px;
  margin-block: 4em;
  margin-left: 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
}

.prose figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.note {
  padding: 18px 20px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 26px;
  margin-top: 52px;
  border-top: 1px solid var(--line);
}

.article-tags a {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.article-tags a:hover {
  color: var(--accent);
}

.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 128px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.post-navigation a {
  display: block;
  min-height: 138px;
  padding: 28px 0;
  text-decoration: none;
}

.post-navigation a + a {
  padding-left: 48px;
  border-left: 1px solid var(--line);
  text-align: right;
}

.post-navigation small {
  display: block;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.post-navigation span {
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  letter-spacing: -0.025em;
}

.post-navigation a:hover span {
  color: var(--accent);
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  padding-block: 30px;
  color: var(--muted);
  font-size: 0.82rem;
}

.pagination a {
  width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.pagination a:last-child {
  justify-self: end;
}

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

.compact-header {
  padding-block: 72px;
}

.comments {
  width: min(100%, 760px);
  padding: 56px 0 128px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.prose .highlight {
  overflow-x: auto;
  margin-block: 1.55em;
  background: var(--code-bg);
}

.prose .highlight table {
  width: auto;
  min-width: 100%;
  margin: 0;
  border: 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.prose .highlight td {
  padding: 22px 0;
  border: 0;
  vertical-align: top;
}

.prose .highlight .gutter {
  width: 1%;
  padding-right: 16px;
  padding-left: 18px;
  color: var(--muted);
  text-align: right;
  user-select: none;
}

.prose .highlight .code {
  padding-right: 24px;
}

.prose .highlight pre {
  padding: 0;
  margin: 0;
  overflow: visible;
  background: transparent;
}

.prose .caption {
  display: block;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.prose .comment,
.prose .quote {
  color: var(--muted);
}

.prose .keyword,
.prose .selector-tag,
.prose .literal,
.prose .name,
.prose .strong {
  color: var(--accent);
}

.prose .string,
.prose .title,
.prose .section,
.prose .type,
.prose .attribute,
.prose .symbol,
.prose .bullet,
.prose .addition,
.prose .variable,
.prose .template-tag,
.prose .template-variable {
  color: #287a57;
}

html[data-theme="dark"] .prose .string,
html[data-theme="dark"] .prose .title,
html[data-theme="dark"] .prose .section,
html[data-theme="dark"] .prose .type,
html[data-theme="dark"] .prose .attribute,
html[data-theme="dark"] .prose .symbol,
html[data-theme="dark"] .prose .bullet,
html[data-theme="dark"] .prose .addition,
html[data-theme="dark"] .prose .variable,
html[data-theme="dark"] .prose .template-tag,
html[data-theme="dark"] .prose .template-variable {
  color: #71c69d;
}

.prose .deletion,
.prose .meta {
  color: #b94b4b;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  padding-block: 72px 128px;
}

.about-grid .prose {
  grid-column: 3 / span 6;
  width: auto;
  padding: 0;
  margin: 0;
}

.about-aside {
  grid-column: 10 / span 3;
  color: var(--muted);
  font-size: 0.88rem;
}

.about-aside dl {
  margin: 0;
}

.about-aside div {
  padding-block: 13px;
  border-bottom: 1px solid var(--line);
}

.about-aside dt {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.about-aside dd {
  margin: 3px 0 0;
  color: var(--ink);
}

.search-panel {
  padding-block: 62px 128px;
}

.search-form {
  position: relative;
  border-bottom: 1px solid var(--ink);
}

.search-form label {
  display: block;
}

.search-form input {
  width: 100%;
  padding: 18px 96px 18px 0;
  border: 0;
  background: transparent;
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.045em;
  outline: 0;
}

.search-form input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.search-form button {
  position: absolute;
  right: 0;
  bottom: 25px;
  cursor: pointer;
  background: transparent;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-meta {
  min-height: 52px;
  padding-block: 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

.search-results {
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  padding-block: 30px;
  border-bottom: 1px solid var(--line);
}

.search-result h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.search-result h2 a {
  text-decoration: none;
}

.search-result h2 a:hover {
  color: var(--accent);
}

.search-result p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
}

.search-result time {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.empty-state {
  padding-block: 52px;
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .home-intro h1 {
    grid-column: 1 / span 7;
  }

  .home-intro p {
    grid-column: 9 / span 4;
  }

  .post-row {
    grid-template-columns: 62px minmax(0, 1fr) auto;
  }

  .page-header .eyebrow,
  .article-header__meta {
    grid-column: 1 / span 3;
  }

  .page-header h1,
  .article-header h1 {
    grid-column: 4 / span 9;
  }

  .page-header p {
    grid-column: 4 / span 7;
    margin-top: 20px;
  }

  .article-header__dek {
    grid-column: 4 / span 8;
  }

  .about-grid .prose {
    grid-column: 1 / span 8;
  }

  .about-aside {
    grid-column: 10 / span 3;
  }
}

@media (max-width: 680px) {
  :root {
    --gutter: 20px;
  }

  .site-header {
    display: block;
    padding-block: 24px 18px;
  }

  .wordmark {
    display: inline-block;
    margin-bottom: 20px;
  }

  .site-nav {
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .site-nav > a {
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .home-intro {
    display: block;
    min-height: 0;
    padding-block: 68px 84px;
  }

  .home-intro h1 {
    font-size: clamp(2.9rem, 15vw, 4.3rem);
  }

  .home-intro p {
    margin-top: 38px;
  }

  .writing {
    margin-bottom: 96px;
  }

  .post-row,
  .archive-year .post-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 14px;
    min-height: 96px;
    padding-block: 18px;
  }

  .post-row time,
  .archive-year .post-row time {
    grid-column: 2;
    margin-top: -7px;
    font-size: 0.78rem;
  }

  .post-row__content p {
    margin-top: 8px;
  }

  .post-row a {
    font-size: 1.35rem;
  }

  .post-arrow {
    font-size: 1.8rem;
  }

  .page-header,
  .article-header {
    display: block;
    padding-block: 68px 50px;
  }

  .page-header h1,
  .article-header h1 {
    margin-top: 28px;
    font-size: clamp(3rem, 15vw, 4.8rem);
  }

  .page-header p,
  .article-header__dek {
    margin-top: 26px;
  }

  .archive {
    padding-block: 42px 96px;
  }

  .archive-year {
    display: block;
  }

  .archive-year h2 {
    margin: 0 0 14px;
  }

  .archive-year + .archive-year {
    margin-top: 60px;
  }

  .prose {
    padding-block: 54px 92px;
    font-size: 1.02rem;
  }

  .post-navigation {
    display: block;
    margin-bottom: 96px;
  }

  .post-navigation a {
    min-height: 0;
  }

  .post-navigation a + a {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .about-grid {
    display: block;
    padding-block: 54px 96px;
  }

  .about-grid .prose {
    padding: 0;
  }

  .about-aside {
    margin-top: 58px;
  }

  .search-result {
    display: block;
  }

  .search-result time {
    display: block;
    margin-top: 14px;
  }

  .site-footer {
    display: block;
  }

  .site-footer nav {
    justify-content: flex-start;
    margin-top: 18px;
  }

  .pagination {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .post-navigation,
  .theme-toggle {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .prose {
    width: 100%;
    padding: 0;
  }
}
