:root {
  color-scheme: light;
  --ink: #0a0a0a;
  --paper: #f4f0e6;
  --yellow: #ffd100;
  --blue: #0057b8;
  --red: #e30613;
  --quiet: #5a5a5a;
  --muted: #3a3a3a;
  --content-width: 74rem;
  --blog-content-width: 49rem;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

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

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

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

a:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}

.demo-link {
  font-weight: 700;
}

main {
  width: 100%;
  max-width: var(--blog-content-width);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) 1.25rem;
  flex: 1;
}

main.post-page {
  padding-bottom: 0;
}

main.post-list-page {
  max-width: var(--content-width);
  padding: clamp(3.5rem, 7vw, 5.5rem) var(--site-gutter) 0;
}

h1, h2, p, ul, figure, table { margin-top: 0; }

h1 {
  font-size: clamp(2.3rem, 6vw, 3.65rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 0.9rem;
}

.blog-header {
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.intro {
  border-left: 4px solid var(--red);
  padding-left: 0.75rem;
  font-size: 1.125rem;
  color: var(--muted);
  margin-bottom: 0;
}

.post-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  border: 2px solid var(--ink);
}

.post-meta, .back-link {
  font: 500 0.8rem/1.5 var(--mono);
  color: var(--quiet);
}

.post-meta { margin-bottom: 0.65rem; }

.back-link {
  display: inline-block;
  border-bottom: 2px solid var(--ink);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.post-header {
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

.post-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.4rem;
}

.post-eyebrow {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 0.4rem 0.7rem;
  font: 700 0.72rem/1.45 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.post-header h1 {
  font-size: clamp(2rem, 5.3vw, 3.1rem);
  line-height: 1.12;
  text-wrap: balance;
  margin-bottom: 1.25rem;
}

.title-accent {
  background: linear-gradient(transparent 72%, var(--yellow) 72%, var(--yellow) 94%, transparent 94%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.post-header .post-meta {
  border-left: 4px solid var(--red);
  padding-left: 0.65rem;
  margin: 0;
}

.post-header .post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.post-header .post-tags li {
  margin: 0;
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 0.15rem 0.5rem;
  font: 600 0.72rem/1.5 var(--mono);
}

.post {
  font-size: 1.0625rem;
}

.post-body {
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: clamp(1rem, 3vw, 1.75rem);
}

.post h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.post p, .post ul { margin-bottom: 1rem; }
.post-body > :last-child { margin-bottom: 0; }
.post ul { padding-left: 1.3rem; }
.post li + li { margin-top: 0.4rem; }

.post-image {
  margin: 1.5rem 0;
}

.post-image-link {
  display: block;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.post-image-link:hover {
  box-shadow: 5px 5px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.post-image figcaption {
  margin-top: 0.5rem;
  color: var(--quiet);
  font: 500 0.8rem/1.5 var(--mono);
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.architecture {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #fff;
  border: 2px solid var(--ink);
}

.architecture svg {
  display: block;
  width: 100%;
  max-width: 27rem;
  height: auto;
  margin: 0 auto;
  font-family: "Space Grotesk", sans-serif;
}

table {
  width: 100%;
  margin-bottom: 1.25rem;
  border: 2px solid var(--ink);
  border-collapse: collapse;
  background: #fff;
}

th, td {
  border-bottom: 1px solid var(--ink);
  padding: 0.65rem 0.85rem;
  text-align: left;
}

th { font-weight: 700; }
th:last-child, td:last-child { text-align: right; }
.best-result { background: var(--yellow); font-weight: 700; }

.demo-link { margin-top: 0.5rem; }

@media (max-width: 380px) {
  .architecture { padding: 0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .post-image-link { transition: none; }
  .post-image-link:hover { transform: none; }
}
