:root {
  color-scheme: light dark;
  --font-body: Charter, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-ui: Inter, "Avenir Next", "Segoe UI", sans-serif;
  --page-width: 64rem;
  --content-width: 42rem;
  --article-width: 48rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --radius: 10px;
  --bg: #fcfcfa;
  --surface: #f4f4ef;
  --text: #171717;
  --text-soft: #4d4d4d;
  --text-faint: #777;
  --line: #ddddda;
  --line-strong: #c6c6c1;
  --accent: #1d4f91;
  --accent-soft: #edf3fb;
  --code-bg: #f3f1ec;
  --code-text: #222;
  --selection: rgba(29, 79, 145, 0.16);
  --media-bg: #f1eee8;
}

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

html {
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  background: var(--bg);
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

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

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

code,
pre,
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre {
  margin: var(--space-5) 0;
  overflow-x: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  line-height: 1.7;
  font-size: 0.99rem;
}

pre code {
  color: inherit;
}


code {
  font-size: 0.9em;
}

:not(pre) > code {
  padding: 0.08rem 0.3rem;
  border-radius: 0.3rem;
  background: var(--code-bg);
  color: var(--code-text);
}

blockquote {
  margin: var(--space-6) 0;
  padding-left: var(--space-5);
  border-left: 3px solid var(--line-strong);
  color: var(--text-soft);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-7) 0;
}

.site-shell {
  width: min(calc(100% - 2rem), var(--page-width));
  margin: 0 auto;
}

.content-wrap {
  width: min(100%, var(--content-width));
}

.content-wrap > :last-child,
.prose-flow > :last-child {
  margin-bottom: 0;
}

.prose-flow > * + * {
  margin-top: var(--space-5);
}

.prose-flow figure,
.prose-flow img,
.prose-flow video {
  margin: var(--space-6) 0;
}

.prose-flow img,
.prose-flow video {
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  background: var(--media-bg);
}

.prose-flow figure {
  margin-left: 0;
  margin-right: 0;
}

.prose-flow figcaption {
  margin-top: var(--space-2);
  color: var(--text-faint);
  font-family: var(--font-ui);
  font-size: 0.86rem;
}

.site-header {
  padding: var(--space-4) 0 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.brand__name {
  font-size: 1.05rem;
  color: var(--text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 0;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  color: var(--text);
}

.hero,
.page-header,
.article-header {
  padding: var(--space-8) 0 var(--space-6);
}

.article-header.content-wrap,
.article-body {
  width: min(100%, var(--article-width));
}

.hero__eyebrow,
.eyebrow {
  margin-bottom: var(--space-3);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero h1,
.page-title,
.article-header h1 {
  margin: 0 0 var(--space-4);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  line-height: 1.08;
  font-weight: 400;
  color: var(--text);
}

.hero p,
.page-intro,
.article-dek {
  width: min(100%, 38rem);
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-soft);
}

.article-dek {
  width: 100%;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: var(--space-4);
  color: var(--text-faint);
  font-family: var(--font-ui);
  font-size: 0.86rem;
}

.hero__meta span:not(:last-child)::after {
  content: " /";
  margin-right: 0.45rem;
}

.tag,
.stack-item {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-faint);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  text-decoration: none;
}

.tag::before {
  content: "#";
}

.stack-item:not(:last-child)::after {
  content: " /";
}

.section {
  padding: 0 0 var(--space-8);
}

.section--tight {
  padding-top: 0;
}

.section__header {
  margin-bottom: var(--space-5);
}

.section__title {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.2;
  font-weight: 400;
}

.section__link {
  display: inline-block;
  margin-top: var(--space-3);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid--columns {
  grid-template-columns: 1fr;
}

.card {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--line);
}

.post-card,
.project-card {
  display: grid;
  gap: var(--space-3);
}

.post-card:first-child,
.project-card:first-child {
  border-top: 1px solid var(--line);
}

.meta-row,
.tag-list,
.stack-list,
.link-list,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-faint);
}

.link-list {
  gap: var(--space-3);
}

.link-chip {
  color: var(--accent);
  text-decoration: none;
}

.post-card h3,
.project-card h3 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
  font-weight: 400;
}

.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

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

.post-card p,
.project-card p,
.lede {
  margin: 0;
  color: var(--text-soft);
}

.article-meta {
  margin-top: var(--space-4);
}

.article-body {
  padding-bottom: var(--space-8);
}

.article-body > * {
  margin-top: 0;
}

.article-body h2,
.article-body h3 {
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

.article-body h2 {
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
  font-size: 1.9rem;
}

.article-body h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
  font-size: 1.4rem;
}

.article-body h2 + *,
.article-body h3 + * {
  margin-top: 0;
}

.article-body ul,
.article-body ol {
  padding-left: 1.25rem;
}

.article-body li + li {
  margin-top: 0.35rem;
}

.article-body li > ul,
.article-body li > ol {
  margin-top: 0.45rem;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-5) 0;
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.article-body th,
.article-body td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.article-body thead th {
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
}


.split-note {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
  margin-top: var(--space-6);
}

.site-footer {
  padding: 0 0 var(--space-7);
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-family: var(--font-ui);
  font-size: 0.92rem;
}

.site-footer__links {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-faint);
  font-family: var(--font-ui);
  font-size: 0.92rem;
}

.theme-switcher__options {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.theme-switcher button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.theme-switcher button:hover,
.theme-switcher button[aria-pressed="true"] {
  color: var(--text);
  background: var(--bg);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -3rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.4rem;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  top: var(--space-4);
}

@media (min-width: 760px) {
  .section__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-4);
  }

  .section__link {
    margin-top: 0;
  }

  .post-card,
  .project-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .post-card > :not(.meta-row),
  .project-card > :not(.meta-row) {
    grid-column: 1;
  }

  .post-card .meta-row,
  .project-card .meta-row {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-content: end;
    text-align: right;
  }

  .split-note {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 759px) {
  .site-header__inner,
  .site-footer__inner {
    flex-direction: column;
    align-items: start;
  }

  .site-nav {
    gap: var(--space-4);
  }

  .site-footer__links {
    width: 100%;
    align-items: center;
  }

  .theme-switcher {
    margin-left: auto;
  }

  .hero,
  .page-header,
  .article-header {
    padding: var(--space-5) 0 var(--space-4);
  }

  .hero__eyebrow,
  .eyebrow {
    margin-bottom: var(--space-2);
  }

  .hero h1,
  .page-title,
  .article-header h1 {
    margin-bottom: var(--space-3);
    font-size: clamp(2.25rem, 10.5vw, 3.15rem);
  }

  .hero p,
  .page-intro,
  .article-dek {
    font-size: 1rem;
  }

  .article-body h2 {
    font-size: 1.56rem;
  }

  .article-body h3 {
    font-size: 1.2rem;
  }

  .hero__meta {
    margin-top: var(--space-4);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315;
    --surface: #171a1d;
    --text: #f2f3f4;
    --text-soft: #c7ccd1;
    --text-faint: #98a1aa;
    --line: #2b3137;
    --line-strong: #3a424a;
    --accent: #8ab4f8;
    --accent-soft: #182230;
    --code-bg: #171b20;
    --code-text: #eef2f6;
    --selection: rgba(138, 180, 248, 0.2);
    --media-bg: #20242a;
  }
}

html[data-theme="light"] {
  --bg: #fcfcfa;
  --surface: #f4f4ef;
  --text: #171717;
  --text-soft: #4d4d4d;
  --text-faint: #777;
  --line: #ddddda;
  --line-strong: #c6c6c1;
  --accent: #1d4f91;
  --accent-soft: #edf3fb;
  --code-bg: #f3f1ec;
  --code-text: #222;
  --selection: rgba(29, 79, 145, 0.16);
}

html[data-theme="dark"] {
  --bg: #111315;
  --surface: #171a1d;
  --text: #f2f3f4;
  --text-soft: #c7ccd1;
  --text-faint: #98a1aa;
  --line: #2b3137;
  --line-strong: #3a424a;
  --accent: #8ab4f8;
  --accent-soft: #182230;
  --code-bg: #171b20;
  --code-text: #eef2f6;
  --selection: rgba(138, 180, 248, 0.2);
  --media-bg: #20242a;
}


