@font-face {
  font-family: "Shantell Sans";
  src: url("/assets/shantell-sans-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Shantell Sans";
  src: url("/assets/fonts/shantell-sans-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: light-dark(#faf9f6, #151719);
  --ink: light-dark(#292d32, #f1f3f5);
  --muted: light-dark(#6b737d, #8f99a7);
  --line: light-dark(#a4a8ab, #68727d);
  --link: light-dark(#2868ad, #62a8f5);
  --rule: light-dark(rgb(41 45 50 / 12%), #30353a);
  --post-bg: light-dark(#fffefa, #202327);
  --post-shadow: 0 1px 0 light-dark(rgb(30 35 40 / 4%), rgb(0 0 0 / 28%));
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --hand: "Shantell Sans", "Comic Sans MS", cursive;
  --content-width: 720px;
  --annotation-gutter: clamp(0px, calc(100vw - 480px), 150px);
  --note-accent: light-dark(#9d593f, #dfa17f);
  --note-muted: light-dark(#6b737d, #a5afbd);
  --note-highlight: light-dark(#f2e7b5, #44402b);
  --reading-font: "Nunito", ui-rounded, system-ui, sans-serif;
  --intro-blue: light-dark(#3355a6, #9badf3);
  --intro-muted: light-dark(#696d64, #a5a99f);
  --writing-wash: light-dark(rgb(225 174 61 / 25%), rgb(226 181 80 / 20%));
  --writing-note: light-dark(#886025, #dfb76e);
  --markdown-accent: light-dark(#b64848, #ff6b6b);
  --expand-accent: light-dark(#9251a0, #d66bea);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:focus-visible,
summary:focus-visible,
.intro-mascot:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
  border-radius: 2px;
}

.page {
  width: min(1020px, calc(100% - 30px));
  margin: 0 auto;
  padding: 88px 0 72px;
}

.intro { position: relative; margin-bottom: 50px; }

.intro-note {
  position: absolute;
  top: 156px;
  left: calc(100% + 18px);
  width: 135px;
  color: var(--note-accent);
  font-family: var(--hand);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  transform: rotate(7deg);
}

.intro-note-arrow {
  display: block;
  margin: 0 0 14px -14px;
  font-size: 3rem;
  line-height: 1;
  transform: rotate(12deg);
}

h1,
.section-title {
  margin: 0;
  font-family: var(--hand);
  font-weight: 700;
  letter-spacing: .01em;
}

h1 {
  font-size: clamp(27px, 4vw, 34px);
  line-height: 1.25;
}

h1 a {
  color: inherit;
  text-decoration: none;
}

.intro p {
  max-width: 920px;
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.48;
}

.intro-personal {
  margin-bottom: 64px;
  font-synthesis: none;
}

.intro-mascot {
  position: absolute;
  top: -18px;
  right: 0;
  display: block;
  width: 112px;
  height: 112px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
}

.intro-mascot-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.intro-mascot:active .intro-mascot-image { opacity: .8; }

.intro-mascot-note {
  position: absolute;
  top: 18px;
  right: -64px;
  color: var(--intro-blue);
  font: 400 20px/1.2 var(--hand);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: rotate(8deg);
  transition: opacity 140ms ease;
}

.intro-mascot:focus-visible .intro-mascot-note { opacity: 1; transition: none; }

@media (hover: hover) and (pointer: fine) {
  .intro-mascot:hover .intro-mascot-note { opacity: 1; }
}

.intro-eyebrow {
  display: inline-block;
  max-width: calc(100% - 132px);
  margin-bottom: 22px;
  color: var(--intro-muted);
  font-family: var(--hand);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  transform: rotate(-3deg);
  transform-origin: left;
}

.intro-personal h1 {
  max-width: calc(100% - 108px);
  margin-bottom: 28px;
  font-family: var(--hand);
  font-size: clamp(2.125rem, 4.5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -.012em;
  line-height: 1.13;
  text-wrap: balance;
}

.intro-personal h1 strong {
  color: var(--intro-blue);
  font-weight: inherit;
  white-space: nowrap;
}

.intro-personal p {
  max-width: 560px;
  margin: 0;
  color: var(--intro-muted);
  font-family: var(--mono);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.8;
  text-wrap: pretty;
}

.intro-personal p strong {
  background: var(--note-highlight);
  box-shadow: 3px 0 var(--note-highlight), -2px 0 var(--note-highlight);
  border-radius: 5px 9px 5px 7px;
  color: var(--ink);
  font-weight: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.intro-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  margin-top: 27px;
  color: var(--intro-blue);
  font-family: var(--hand);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.intro-link span { font-size: 1.25rem; }
#now { scroll-margin-top: 32px; }

details > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

details > summary::-webkit-details-marker { display: none; }
.section { margin-top: 52px; }

.section-title {
  position: relative;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 11px;
  font-size: 26px;
  line-height: 1.3;
}

.intro,
.section,
.site-footer {
  width: min(var(--content-width), calc(100% - var(--annotation-gutter)));
  margin-left: var(--annotation-gutter);
}

.markdown-token { display: inline-block; }

.markdown-note {
  position: absolute;
  top: 1px;
  right: calc(100% + 28px);
  width: 108px;
  color: var(--markdown-accent);
  font-family: var(--hand);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .01em;
  text-align: left;
  transform: rotate(-2deg);
}

.section-title.annotation-on-right .markdown-note {
  right: auto;
  left: calc(100% + 24px);
}

.expand-annotation {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.expand-annotation > .tree {
  width: max-content;
  max-width: 100%;
}

.expand-note {
  position: absolute;
  top: 50%;
  right: calc(100% + 42px);
  color: var(--expand-accent);
  font-family: var(--hand);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(-50%) rotate(-2deg);
}

.expand-annotation.bracket-bottom { margin-bottom: 60px; }

.expand-annotation.bracket-bottom .expand-note {
  top: calc(100% + 28px);
  right: auto;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
}

.branch-title::after {
  content: "+";
  color: var(--muted);
  font-family: var(--mono);
  font-size: .65em;
  font-weight: 700;
}

details[open] > .branch-title::after { content: "−"; }
.branch-title.always-expanded::after { content: none; }

.tree {
  position: relative;
  margin: 18px 0 0 12px;
  padding: 0 0 0 27px;
  list-style: none;
}

.tree > li {
  position: relative;
  min-height: 34px;
  margin: 0;
  padding: 4px 0;
}

.tree > li::before {
  content: "";
  position: absolute;
  top: 16px;
  left: -27px;
  width: 22px;
  border-top: 2px solid var(--line);
}

.tree > li::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -27px;
  border-left: 2px solid var(--line);
}

.tree > li:last-child::after {
  bottom: auto;
  height: 16px;
}

.tree .tree {
  margin-top: 3px;
  margin-left: 8px;
}

.branch-title {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
}

.branch-title a { white-space: nowrap; }
.muted { color: var(--muted); }

.portfolio strong,
.previously strong { color: var(--muted); }

.post-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 18px;
  width: min(560px, 100%);
  padding: 3px 0 10px;
  align-items: start;
}

.post-link {
  display: block;
  overflow: hidden;
  background: var(--post-bg);
  box-shadow: var(--post-shadow);
}

.post-link img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 120ms ease;
}

.post-link:hover img { opacity: .82; }

.loading,
.load-error {
  color: var(--muted);
  font-weight: 600;
}

.writing-section { margin-top: 50px; }

.writing-heading {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 22px;
  padding: 0 0 18px;
}

.writing-caption,
.writing-footnote {
  font-family: var(--hand);
  font-weight: 700;
}

.writing-caption {
  color: var(--writing-note);
  font-size: 15px;
  line-height: 1.4;
  transform: rotate(-3deg);
}

/* Featured articles share the homepage tree rails. */
.writing-index-link { position: relative; display: inline-flex; align-items: baseline; gap: 10px; color: var(--ink); text-decoration: none; }
.writing-arrow { color: var(--intro-blue); font-family: var(--mono); font-size: 20px; }
.featured-tree { margin-top: 0; }
.featured-topic { font-size: 17px; }
.featured-post { display: block; width: fit-content; max-width: 100%; min-height: 26px; padding: 0; cursor: pointer; touch-action: manipulation; }
.featured-title { color: var(--link); font-family: var(--mono); font-size: inherit; font-weight: 700; line-height: 1.5; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.featured-reading { --signoff-inset: clamp(24px, 12%, 80px); padding: 18px 0 20px; overflow-wrap: anywhere; font-synthesis: none; }
.featured-reading .writing-prose { font-family: var(--reading-font); font-size: 18px; line-height: 1.8; }
.featured-actions { display: flex; }
.featured-actions a, [data-retry-post] { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--intro-blue); font: 400 14px/1.7 var(--reading-font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; touch-action: manipulation; }
.featured-reading button:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
.featured-post:active { color: var(--ink); background: var(--note-highlight); }

.reading-page { width: min(720px, 100%); margin-inline: auto; }
.writing-nav { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 38px; }
.writing-nav a, .article-end a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 400; text-decoration: none; }
.archive-header h1, .article-header h1 { font-size: clamp(30px, 4.5vw, 44px); line-height: 1.25; letter-spacing: -.015em; text-wrap: balance; overflow-wrap: anywhere; }
.archive-header p { margin: 16px 0 0; color: var(--intro-muted); font-size: 15px; }
#archive-results { margin-top: 48px; }
.archive-context { margin: 0 0 28px; color: var(--note-muted); font-size: 13px; }
.archive-list { display: grid; gap: 36px; list-style: none; margin: 0; padding: 0; }
.archive-post { overflow-wrap: anywhere; }
.archive-post-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; font-family: var(--mono); font-size: 20px; font-weight: 700; line-height: 1.5; }
.archive-post-title > span { flex-shrink: 0; color: var(--intro-blue); }
.archive-post-title a, .archive-read-more { color: var(--ink); text-decoration-color: var(--intro-blue); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.archive-post time { display: block; color: var(--note-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.archive-post-description { margin: 4px 0 0; color: var(--ink); font-size: 16px; line-height: 1.75; }
.archive-read-more { display: inline-block; min-height: 44px; padding-block: 10px; font-size: 16px; font-weight: 400; }
.archive-empty { padding: 20px 0; color: var(--note-muted); line-height: 1.8; }
.archive-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin-top: 24px; color: var(--note-muted); font-size: 12px; }
.archive-pagination a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
.archive-pagination > :last-child { justify-self: end; }
.feed-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 30px; font-size: 12px; font-weight: 400; }
.article-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; margin-bottom: 22px; color: var(--note-muted); font-size: 13px; }
.article-meta a { font-weight: 400; }
.article-prose { margin-top: 36px; font-family: var(--reading-font); font-size: 18px; line-height: 1.85; overflow-wrap: anywhere; }
.article-end { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--rule); }
.reading-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--note-muted); font-size: 12px; }
.reading-footer a { display: grid; place-items: center; min-width: 44px; min-height: 44px; font-size: 24px; text-decoration: none; }

.writing-prose > :first-child { margin-top: 0; }
.writing-prose p { margin: 18px 0; }
.writing-prose > p:last-child { margin-bottom: 16px; }
.writing-prose h2,
.writing-prose h3,
.writing-prose h4,
.writing-prose h5,
.writing-prose h6 {
  margin: 28px 0 14px;
  font-family: var(--hand);
  line-height: 1.4;
}
.writing-prose h2 { font-size: 26px; }
.writing-prose h3 { font-size: 23px; }
.writing-prose h4 { font-size: 20px; }
.writing-prose h5,
.writing-prose h6 { font-size: 18px; }
.writing-prose ul,
.writing-prose ol { padding-left: 24px; }
.writing-prose img { display: block; max-width: 100%; height: auto; margin: 24px 0; }
.writing-prose blockquote { margin: 24px 0; padding-left: 18px; border-left: 2px solid var(--line); color: var(--note-muted); }
.writing-prose code { font-family: var(--mono); font-size: .83em; }
.writing-prose :not(pre) > code { background: var(--note-highlight); padding: 2px 4px; border-radius: 3px; }
.writing-prose pre { overflow-x: auto; padding: 16px; background: var(--post-bg); border: 1px solid var(--rule); border-radius: 4px; }
.writing-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 24px 0; }
.writing-prose th,
.writing-prose td { border-bottom: 1px solid var(--line); padding: 8px 14px; text-align: left; }
.writing-prose .note-label { margin: 2px 0 20px; color: var(--note-accent); font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }
.featured-reading .note-label { font-family: var(--reading-font); letter-spacing: .6px; }
.writing-prose .article-signature { width: fit-content; margin: 18px 0 16px; color: var(--ink); font-family: var(--hand); font-size: 26px; font-weight: 400; line-height: 1.5; font-synthesis: none; transform: rotate(-4deg); }
.featured-reading .writing-prose .article-signature { max-width: calc(100% - var(--signoff-inset)); margin-inline-start: auto; margin-inline-end: var(--signoff-inset); margin-bottom: 0; text-align: end; }
.writing-footnote {
  margin: 22px 0 0;
  color: var(--note-muted);
  text-align: right;
  font-size: 15px;
  line-height: 1.5;
  transform: rotate(-2deg);
}

.prose-section { margin-top: 76px; }
.heading-dot { color: var(--intro-blue); }

.section-prose {
  max-width: 65ch;
  margin-top: 30px;
  color: var(--intro-muted);
  font-size: 1.0625rem;
  line-height: 1.85;
}

.section-prose p { margin: 0 0 26px; }
.section-prose p:last-child { margin-bottom: 0; }

.section-signature {
  width: fit-content;
  margin-top: 32px;
  font-family: var(--hand);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  transform: rotate(-7deg);
}

.site-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  color: var(--note-muted);
  font-size: 12px;
  line-height: 1.6;
}

.footer-label {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.back-to-top {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  color: var(--intro-blue);
  font-family: var(--hand);
  font-size: 1.5rem;
  text-decoration: none;
}

::selection { background: var(--note-highlight); color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .writing-index-link:hover { color: var(--intro-blue); text-decoration: underline; text-underline-offset: 4px; }
  .archive-post-title a:hover, .archive-read-more:hover { color: var(--intro-blue); }
  .writing-nav a:hover, .article-end a:hover { text-decoration: underline; }
  .intro-link:hover { text-decoration: underline; }
  .back-to-top:hover { background: var(--note-highlight); border-radius: 45% 55% 48% 52%; }
}

@media (max-width: 1180px) {
  .intro-note { display: none; }
  .intro-mascot-note { top: calc(100% - 2px); right: 4px; font-size: 18px; transform: rotate(-5deg); }
}

@media (max-width: 680px) {
  body { font-size: 14px; }

  .page {
    width: min(100% - 30px, 1020px);
    padding: 64px 0 48px;
  }

  .intro { margin-bottom: 38px; }
  .intro-mascot { top: -8px; width: 76px; height: 76px; }
  .intro-mascot-note { display: none; }
  .intro-eyebrow { max-width: calc(100% - 92px); min-height: 52px; margin-bottom: 18px; font-size: 1rem; }
  .intro-personal h1 { max-width: 100%; margin-bottom: 22px; font-size: clamp(1.875rem, 7.8vw, 2.75rem); }
  .intro-personal p { font-size: 1rem; line-height: 1.85; }
  .intro-link { margin-top: 18px; font-size: 1.125rem; }
  .section { margin-top: 38px; }
  .section-title { font-size: 23px; }
  .markdown-note {
    top: 0;
    width: 92px;
    font-size: 15px;
  }
  .section-title.annotation-on-right .markdown-note { left: calc(100% + 16px); }
  .expand-note { font-size: 15px; }
  .expand-annotation.bracket-bottom { margin-bottom: 68px; }
  .expand-annotation > .tree { max-width: 100%; }
  .tree { margin-left: 8px; padding-left: 23px; }
  .tree > li::before { left: -23px; width: 18px; }
  .tree > li::after { left: -23px; }
  .tree .tree { margin-left: 4px; }
  .post-row { gap: 9px; }
  .branch-title { gap: 6px; }
  .writing-section { margin-top: 38px; }
  .writing-heading { flex-wrap: wrap; gap: 7px 14px; padding: 0 0 18px; }
  .writing-caption { font-size: 14px; }
  .featured-topic { font-size: 15px; }
  .writing-nav { margin-bottom: 28px; }
  #archive-results { margin-top: 36px; }
  .archive-list { gap: 28px; }
  .archive-post-title { gap: 8px; font-size: 18px; }
  .article-prose { margin-top: 28px; }
  .archive-pagination { gap: 10px; }
  .writing-footnote { font-size: 13px; }
  .prose-section { margin-top: 56px; }
  .section-prose { margin-top: 24px; font-size: 1rem; }
  .section-signature { margin-top: 28px; font-size: 1.875rem; }
  .site-footer { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 7px 12px; margin-top: 40px; padding-top: 20px; }
  .footer-label { grid-column: 1; margin-left: 0; }
  .back-to-top { grid-column: 2; grid-row: 1 / span 2; }
}

@media (pointer: coarse), (max-width: 680px) {
  .featured-tree > li, .featured-tree > li > details > .tree > li { padding-block: 0; }
  .featured-tree > li::before, .featured-tree > li > details > .tree > li::before { top: 22px; }
  .featured-tree > li:last-child::after, .featured-tree > li > details > .tree > li:last-child::after { height: 22px; }
  .featured-topic { min-height: 44px; align-items: center; }
  .featured-post { min-height: 44px; padding-block: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .post-link img, .intro-mascot-note { transition: none; }
}
