:root {
  --accent: #ff0534;
  --bg: #ffffff;
  --bg-soft: #f6f5f4;
  --text: #16181c;
  --text-muted: #5c6169;
  --rule: #e4e2df;
  --radius: 6px;
  --measure: 34rem;
  --wide: 60rem;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    Helvetica, Arial, sans-serif;
  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --bg-soft: #1c1c21;
    --text: #ececee;
    --text-muted: #a0a2a8;
    --rule: #2c2c33;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.15em;
}

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

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--bg);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
}

.brand {
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.brand img {
  height: 2rem;
  width: auto;
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9375rem;
}

.site-header nav a {
  text-decoration: none;
  color: var(--text-muted);
}

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

.site-header nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

/* Shared blocks ----------------------------------------------------------- */

main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.intro {
  max-width: var(--measure);
  margin: 2rem 0 3rem;
}

.intro h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

.intro p {
  color: var(--text-muted);
  margin: 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

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

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

/* Post list --------------------------------------------------------------- */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2.5rem;
}

.card {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.card:last-child {
  border-bottom: 0;
}

@media (min-width: 46rem) {
  .card {
    grid-template-columns: 16rem minmax(0, 1fr);
    align-items: start;
  }
}

.card-image img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.card-body h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.card-body h2 a {
  text-decoration: none;
}

.summary {
  margin: 0;
  color: var(--text-muted);
  max-width: var(--measure);
}

/* Single post ------------------------------------------------------------- */

.post-header {
  max-width: var(--measure);
  margin: 2rem 0 2rem;
}

.post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
}

.lede {
  font-size: 1.1875rem;
  color: var(--text-muted);
  margin: 0;
}

.feature {
  margin: 0 0 2.5rem;
}

.feature img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: 1.25em;
}

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin-top: 2.25em;
  margin-bottom: -0.35em;
}

.prose h2 {
  font-size: 1.5rem;
}

.prose h3 {
  font-size: 1.2rem;
}

.prose blockquote {
  margin-inline: 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: 1.1875rem;
  color: var(--text);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin-block: 2.5rem;
}

.prose code {
  background: var(--bg-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

.prose pre {
  background: var(--bg-soft);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
}

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

.prose li + li {
  margin-top: 0.35em;
}

/* Ghost card markup preserved from the original content ------------------- */

.kg-card {
  margin-block: 2rem;
}

.kg-image-card img,
.kg-image {
  border-radius: var(--radius);
}

.kg-card figcaption,
.kg-card-hascaption figcaption {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
}

.kg-embed-card {
  margin-inline: 0;
}

/* Some embeds came through as bare iframes with fixed width attributes;
   stack them and let them fit the text column. */
.prose iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: var(--radius);
  margin-block: 1.5rem;
}

.kg-callout-card {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.kg-callout-card-blue {
  background: color-mix(in srgb, #3b82f6 12%, var(--bg));
}

.kg-callout-text {
  margin: 0;
}

.kg-blockquote-alt {
  font-family: var(--font-display);
  font-size: 1.25rem;
  border: 0;
  padding-left: 0;
  text-align: center;
  color: var(--text-muted);
}

/* Wide media breaks out of the text column on large screens */
@media (min-width: 60rem) {
  .prose .kg-embed-card,
  .prose .kg-width-wide {
    width: min(48rem, 90vw);
  }
}

/* Tags page --------------------------------------------------------------- */

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.tag-list .count {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Newsletter -------------------------------------------------------------- */

.newsletter {
  max-width: var(--measure);
  margin: 0 auto 4rem;
  padding: 2rem 1.5rem;
  background: var(--bg-soft);
  border-radius: var(--radius);
  text-align: center;
}

.newsletter h2 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
}

.newsletter p {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.newsletter-form input {
  flex: 1 1 15rem;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.newsletter-form input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.newsletter-form button {
  padding: 0.6rem 1.25rem;
  font: inherit;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.newsletter-form button:hover {
  filter: brightness(1.1);
}

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

/* Footer ------------------------------------------------------------------ */

.post-nav {
  max-width: var(--measure);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.post-nav a {
  text-decoration: none;
  color: var(--text-muted);
}

.site-footer {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
}

.site-footer p {
  margin: 0;
}

.colophon {
  flex-basis: 100%;
}
