@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-tight/InterTight-Latin-Variable.woff2") format("woff2");
}

@font-face {
  font-family: "Inter Tight";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-tight/InterTight-Latin-Italic-Variable.woff2") format("woff2");
}

:root {
  --color-background: #ffffff;
  --color-surface: #f9f9f9;
  --color-text: #181d2a;
  --color-heading: #333333;
  --color-muted: #6a7a8b;
  --color-border: #e5e5e5;
  --color-link: #428bca;
  --color-link-hover: #1a3152;
  --color-code: #282a36;
  --header-height: 4.25rem;
  --page-padding: clamp(1.25rem, 4vw, 3rem);
  --font-sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --font-mono: Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 16px;
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: var(--color-link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
  transition: color 140ms ease;
}

a:hover {
  color: var(--color-link-hover);
}

a:focus-visible,
summary:focus-visible {
  border-radius: 0.125rem;
  outline: 3px solid var(--color-link);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.85rem;
  transform: translateY(-180%);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-weight: 650;
}

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

.site-shell {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: var(--page-padding);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  min-height: var(--header-height);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-brand {
  color: var(--color-heading);
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 720;
  letter-spacing: -0.025em;
  text-decoration: none;
  white-space: nowrap;
}

.home-page .site-brand {
  display: none;
}

.site-nav ul,
.footer-nav ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav ul {
  gap: clamp(1rem, 3vw, 2rem);
}

.site-nav a {
  display: block;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
  color: var(--color-muted);
  font-size: 0.92rem;
  font-weight: 560;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.is-current {
  color: var(--color-link);
}

.site-nav a.is-current {
  border-bottom-color: var(--color-link);
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-main {
  display: flex;
  align-items: center;
  padding-block: clamp(4rem, 10vw, 8rem);
}

.home-shell {
  max-width: 76rem;
}

.home-intro > p {
  max-width: 48rem;
  margin: 0 0 1.2rem;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
}

#main-content .home-intro > h1 {
  max-width: 68rem;
  margin-top: 0;
  margin-bottom: clamp(2rem, 5vw, 4rem);
  color: var(--color-text);
  font-size: clamp(2.4rem, 5.5vw, 4.75rem);
  font-weight: 580;
  letter-spacing: normal;
  line-height: 0.92;
}

.home-headline__secondary {
  font-size: 0.65em;
  letter-spacing: -0.045em;
  line-height: 1;
}

.home-intro img {
  width: min(100%, 62rem);
  margin-top: clamp(3rem, 8vw, 7rem);
  image-rendering: auto;
}

.home-intro > p:last-child {
  max-width: none;
}

.life-heading {
  position: relative;
}

.life-heading canvas {
  position: absolute;
  display: block;
  pointer-events: none;
}

.life-heading canvas[hidden] {
  display: none;
}

.life-heading.life-active [data-life-label] {
  opacity: 0;
}

.life-heading[tabindex] {
  cursor: crosshair;
}

.life-heading:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.page-main,
.listing-main,
.not-found-main {
  padding-block: clamp(4rem, 9vw, 8rem);
}

.page-shell,
.listing-shell,
.not-found-shell {
  max-width: 52rem;
}

.page-header,
.article-header {
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.page-header h1,
.not-found-shell h1,
.article-header h1 {
  margin: 0;
  color: var(--color-heading);
  font-weight: 580;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.page-header h1,
.not-found-shell h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
}

.section-intro {
  margin-bottom: 3rem;
}

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

.post-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1.5rem;
  padding-block: clamp(1.25rem, 3vw, 1.85rem);
  border-bottom: 1px solid var(--color-border);
}

.post-item a {
  color: var(--color-text);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 520;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-decoration: none;
}

.post-item a:hover {
  color: var(--color-link);
}

.post-item time,
.article-meta {
  color: var(--color-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.article-main {
  padding-block: clamp(4rem, 9vw, 8rem);
}

.article-header {
  max-width: 74rem;
}

.article-header h1 {
  max-width: 72rem;
  font-size: clamp(2.7rem, 6vw, 5.25rem);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: clamp(1.5rem, 4vw, 2.5rem) 0 0;
}

.article-media {
  max-width: 78rem;
  margin-bottom: clamp(4rem, 8vw, 7rem);
}

.article-media img,
.article-media video {
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  background: var(--color-surface);
}

.article-media img {
  aspect-ratio: 3 / 2;
}

.article-media video {
  aspect-ratio: 8 / 3;
}

.article-layout {
  max-width: 78rem;
}

.article-body {
  width: 100%;
  max-width: 46rem;
  min-width: 0;
  margin-inline: auto;
}

.article-toc--desktop {
  display: none;
}

.article-toc--mobile {
  position: sticky;
  top: var(--header-height);
  z-index: 20;
  max-height: calc(100vh - var(--header-height) - 1.5rem);
  margin-bottom: 3rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.article-toc--mobile[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.article-toc--mobile summary {
  padding: 0.9rem 1rem;
  color: var(--color-heading);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 650;
}

.article-toc nav {
  color: #5e6f80;
  font-size: 0.84rem;
  line-height: 1.3;
}

.article-toc--mobile nav {
  min-height: 0;
  padding: 0 1rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.article-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-toc li {
  margin: 0;
}

.article-toc li li {
  padding-left: 1rem;
}

.article-toc a {
  display: block;
  padding-block: 0.38rem;
  color: inherit;
  text-decoration: none;
}

.article-toc a:hover,
.article-toc a[aria-current="location"] {
  color: var(--color-link);
}

.toc-title {
  margin: 0 0 1rem;
  color: var(--color-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.markdown {
  color: var(--color-text);
  font-size: clamp(1.08rem, 1.7vw, 1.2rem);
  line-height: 1.68;
}

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

.markdown p {
  margin: 0 0 1.5em;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  color: var(--color-heading);
  font-weight: 620;
  letter-spacing: -0.035em;
  line-height: 1.1;
  scroll-margin-top: calc(var(--header-height) + 2rem);
}

.markdown h1 {
  margin: 3.25rem 0 1.4rem;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
}

.markdown h2 {
  margin: clamp(4.25rem, 9vw, 7rem) 0 1.4rem;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
}

.markdown h3 {
  margin: 3.5rem 0 1.1rem;
  font-size: clamp(1.55rem, 3.5vw, 2.25rem);
}

.markdown h4,
.markdown h5,
.markdown h6 {
  margin: 2.5rem 0 0.85rem;
  font-size: 1.2rem;
}

.markdown strong,
.markdown dt {
  font-weight: 680;
}

.markdown em {
  font-style: italic;
}

.markdown ul,
.markdown ol,
.markdown dl {
  margin: 0 0 1.75rem;
}

.markdown ul,
.markdown ol {
  padding-left: 1.35em;
}

.markdown ul {
  list-style: disc;
}

.markdown ol {
  list-style: decimal;
}

.markdown li {
  margin-bottom: 0.55rem;
  padding-left: 0.25rem;
}

.markdown li > ul,
.markdown li > ol {
  margin-top: 0.55rem;
  margin-bottom: 0;
}

.markdown dd {
  margin: 0 0 1rem;
}

.markdown blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.4rem;
  border-left: 3px solid var(--color-link);
  color: var(--color-muted);
  font-size: 1.05em;
}

.markdown blockquote > :last-child {
  margin-bottom: 0;
}

.markdown hr {
  margin: 4rem 0;
  border: 0;
  border-top: 1px solid var(--color-border);
}

.markdown code,
kbd {
  font-family: var(--font-mono);
}

.markdown :not(pre) > code,
kbd {
  padding: 0.14em 0.35em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.16rem;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.markdown pre {
  max-width: 100%;
  margin: 2rem 0;
  padding: 1.25rem;
  overflow-x: auto;
  background: var(--color-code);
  color: #f9f9f9;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre;
}

.markdown pre code {
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  overflow-wrap: normal;
}

/* Monokai-compatible colours for Highlight.js' build-time markup. */
.hljs-comment,
.hljs-quote { color: #75715e; }
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst { color: #f92672; }
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr { color: #ae81ff; }
.hljs-string,
.hljs-doctag { color: #e6db74; }
.hljs-title,
.hljs-section,
.hljs-selector-id { color: #a6e22e; }
.hljs-type,
.hljs-class .hljs-title { color: #66d9ef; }
.hljs-tag,
.hljs-name,
.hljs-attribute { color: #f92672; }
.hljs-regexp,
.hljs-link { color: #fd971f; }
.hljs-symbol,
.hljs-bullet { color: #ae81ff; }
.hljs-built_in,
.hljs-builtin-name { color: #66d9ef; }
.hljs-meta { color: #f8f8f2; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

.katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.markdown figure,
.markdown img,
.markdown video {
  height: auto;
}

.markdown figure {
  margin: 2.5rem 0;
}

.markdown figure img,
.markdown p > img,
.markdown > img,
.markdown video {
  width: 100%;
}

.markdown figcaption {
  margin-top: 0.75rem;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.markdown table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 2.5rem 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: nowrap;
}

.markdown th,
.markdown td {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

.markdown th,
.markdown tbody tr:nth-child(odd) td {
  background: var(--color-surface);
}

.markdown th {
  font-weight: 680;
}

.markdown .footnotes {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.88em;
}

.markdown .footnote-ref {
  font-size: 0.7em;
}

.not-found-main {
  display: flex;
  align-items: center;
}

.not-found-shell {
  max-width: 58rem;
}

.not-found-shell h1 {
  margin-bottom: 1.5rem;
}

.not-found-shell > p:not(.eyebrow) {
  max-width: 34rem;
  margin: 0 0 2rem;
  color: var(--color-muted);
  font-size: 1.2rem;
}

.text-link {
  font-weight: 650;
}

.site-footer {
  width: 100%;
  margin-top: auto;
  padding-block: 2rem;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}

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

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

.footer-nav ul {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem 1.1rem;
}

@media (min-width: 65.625rem) {
  .article-layout.has-toc {
    display: grid;
    grid-template-columns: 14rem minmax(0, 46rem);
    justify-content: center;
    align-items: start;
    gap: clamp(3.5rem, 6vw, 6.5rem);
  }

  .article-layout.has-toc .article-body {
    margin: 0;
  }

  .article-toc--desktop {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    max-height: calc(100vh - var(--header-height) - 4rem);
    overflow-y: auto;
  }

  .article-toc--desktop nav > ul {
    counter-reset: toc-section;
  }

  .article-toc--desktop nav > ul > li {
    counter-increment: toc-section;
  }

  .article-toc--desktop nav > ul > li > a {
    display: grid;
    grid-template-columns: 1.7rem minmax(0, 1fr);
    gap: 0.35rem;
  }

  .article-toc--desktop nav > ul > li > a::before {
    content: counter(toc-section, decimal-leading-zero);
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
  }

  .article-toc--mobile {
    display: none;
  }

  .article-body > pre,
  .article-body > .highlight,
  .article-body > figure,
  .article-body > video,
  .article-body > table,
  .article-body > p > img:only-child {
    width: min(56rem, calc(100vw - 6rem));
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
  }

  .article-body > .highlight pre {
    margin: 2rem 0;
  }
}

@media (max-width: 42rem) {
  :root {
    --header-height: 4rem;
  }

  .site-header__inner {
    gap: 1rem;
  }

  .site-brand {
    max-width: 11.5rem;
    line-height: 1.05;
    white-space: normal;
  }

  .site-nav ul {
    gap: 0.85rem;
  }

  .site-nav a {
    font-size: 0.86rem;
  }

  #main-content .home-intro > h1 {
    font-size: clamp(2.4rem, 11vw, 3.75rem);
  }

  .post-item {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .post-item time {
    grid-row: 1;
  }

  .article-header h1 {
    font-size: clamp(2.4rem, 10.5vw, 3.5rem);
  }

  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-nav ul {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
:root {
  --color-surface: #f9f9f9;
  --color-text: #181d2a;
  --color-muted: #6a7a8b;
  --color-link: #428bca;
  --color-link-hover: #1a3152;
  --color-code: #282a36;
}
