:root {
  --paper: hsl(36, 24%, 97%);
  --paper-2: hsl(32, 18%, 94%);
  --ink: hsl(228, 22%, 10%);
  --ink-2: hsl(228, 12%, 28%);
  --ink-3: hsl(228, 8%, 46%);
  --rule: hsl(228, 12%, 86%);
  --accent: hsl(258, 72%, 48%);
  --accent-soft: hsla(258, 72%, 48%, 0.1);
  --r: 14px;
  --max: 1120px;
  --read: 38rem;
  --article-canvas: 74rem;
  --article-read: 45rem;
  --gutter: max(clamp(1.15rem, 4vw, 2.5rem), env(safe-area-inset-left, 0px));
  --gutter-r: max(clamp(1.15rem, 4vw, 2.5rem), env(safe-area-inset-right, 0px));
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  min-height: 100%;
  min-width: 0;
  max-width: 100%;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
}

.skip:focus {
  top: calc(0.5rem + env(safe-area-inset-top, 0px));
}

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

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
  min-width: 0;
}

.site-header {
  border-bottom: 1px solid var(--rule);
  background: hsla(36, 24%, 97%, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 56px;
  min-width: 0;
}

.logo {
  flex: 0 0 auto;
}

.logo img {
  height: 22px;
  width: auto;
  filter: brightness(0);
  opacity: 0.88;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.15rem;
  min-width: 0;
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 999px;
  white-space: nowrap;
}

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

.nav a.nav-blog { display: none; }
.nav .hide-sm { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--ink);
  color: #fff;
  text-align: center;
}

.btn:hover { opacity: 0.88; }

.btn-beta {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0.15rem;
  padding: 0.22em 0.48em 0.18em;
  font-size: 0.625em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  border-radius: 999px;
  background: hsla(0, 0%, 100%, 0.2);
}

.btn-ghost .btn-beta {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav a.btn,
.nav a.btn:hover,
.nav a.btn[aria-current="page"] {
  color: #fff;
  padding: 0.45rem 0.95rem;
  flex: 0 0 auto;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}

.masthead {
  padding: 2.25rem 0 1.75rem;
  border-bottom: 1px solid var(--rule);
}

.kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0;
}

.masthead .kicker { margin-bottom: 0.75rem; }

.masthead h1 {
  font-size: clamp(2.15rem, 11vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.masthead .dek {
  margin-top: 0.85rem;
  max-width: 28rem;
  font-size: 1.0625rem;
  color: var(--ink-2);
  line-height: 1.5;
  text-wrap: pretty;
}

.featured {
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}

.featured-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "kicker"
    "meta"
    "title"
    "excerpt";
  column-gap: 1rem;
  row-gap: 0.45rem;
  align-items: baseline;
}

.featured-inner .kicker { grid-area: kicker; min-width: 0; }
.featured-inner .meta { grid-area: meta; justify-self: start; min-width: 0; }
.featured-inner h2 { grid-area: title; min-width: 0; }
.featured-inner .excerpt { grid-area: excerpt; }

.featured h2 {
  font-size: clamp(1.65rem, 6.5vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0.15rem 0 0.2rem;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.featured h2 a { display: inline; }
.featured h2 a:hover { color: var(--accent); }

.meta {
  font-size: 0.8125rem;
  color: var(--ink-3);
  display: flex;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.meta > * { min-width: 0; overflow-wrap: anywhere; }

.excerpt {
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.55;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.feed {
  padding: 2rem 0 0.5rem;
}

.feed-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  min-width: 0;
}

.cats {
  display: flex;
  gap: 0 1.15rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.cats::-webkit-scrollbar { display: none; }

.cats a,
.cats span {
  flex: 0 0 auto;
  padding: 0.45rem 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}

.cats a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.list { list-style: none; }

.list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "title"
    "meta"
    "excerpt";
  gap: 0.3rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--rule);
  min-width: 0;
}

.list h3 {
  grid-area: title;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.list h3 a {
  display: inline;
}

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

.list .meta,
.list time {
  grid-area: meta;
  padding-top: 0;
}

.list p {
  grid-area: excerpt;
  margin-top: 0.15rem;
  color: var(--ink-2);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.cta-band {
  margin: 1.75rem 0 2.25rem;
  padding: 1.35rem 1.15rem;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  min-width: 0;
}

.cta-band p { color: var(--ink-2); font-size: 0.95rem; max-width: 36rem; min-width: 0; }
.cta-band strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 0.25rem; }

.cta-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.cta-actions .btn { width: 100%; }

.cta-actions .btn-ghost {
  background: var(--ink);
  color: #fff;
  border-color: transparent;
}

.cta-actions .btn-ghost .btn-beta {
  background: hsla(0, 0%, 100%, 0.2);
  color: inherit;
}

.article-wrap {
  padding: 1.35rem 0 3.25rem;
}

.article-canvas {
  max-width: var(--article-canvas);
}

.article { min-width: 0; }

.article-head {
  max-width: min(52rem, 100%);
  padding-bottom: 1.65rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

.article-head .kicker { margin-bottom: 0.85rem; }

.article-head h1 {
  font-size: clamp(2.05rem, 1.15rem + 3.4vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.042em;
  line-height: 1.08;
  margin: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.article-head .dek {
  margin-top: 1.05rem;
  max-width: 40rem;
  font-size: clamp(1.1rem, 1rem + 0.35vw, 1.3125rem);
  font-weight: 400;
  color: var(--ink-2);
  line-height: 1.5;
  text-wrap: pretty;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
  margin-top: 1.15rem;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}

.byline-author { color: var(--ink-3); font-weight: 500; }

.article-layout { min-width: 0; }

.article-main {
  min-width: 0;
  max-width: var(--article-read);
}

.article-rail { display: none; }

.toc-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.8rem;
}

.toc ol {
  list-style: none;
  display: grid;
  gap: 0.05rem;
}

.toc a {
  display: block;
  padding: 0.32rem 0 0.32rem 0.8rem;
  border-left: 1px solid var(--rule);
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--ink-3);
}

.toc a:hover {
  color: var(--ink);
  border-left-color: var(--accent);
}

.prose {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-2);
  min-width: 0;
}

.prose > * { max-width: 100%; }

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

.prose p + p { margin-top: 1.55em; }

.prose > p:first-child {
  color: var(--ink-2);
  text-wrap: pretty;
}

.prose h2 {
  font-size: clamp(1.375rem, 1.18rem + 0.45vw, 1.6875rem);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.028em;
  margin-top: 2.35em;
  margin-bottom: 0;
  line-height: 1.22;
  overflow-wrap: anywhere;
  text-wrap: balance;
  scroll-margin-top: 5.5rem;
}

.prose h3 {
  font-size: clamp(1.125rem, 1.06rem + 0.22vw, 1.3125rem);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-top: 1.65em;
  line-height: 1.3;
  overflow-wrap: anywhere;
  scroll-margin-top: 5.5rem;
}

.prose h2 + *,
.prose h3 + * { margin-top: 0.7em; }

.prose p,
.prose li { overflow-wrap: anywhere; text-wrap: pretty; }

.prose strong { color: var(--ink); font-weight: 600; }

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: hsla(258, 72%, 48%, 0.42);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.prose a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.prose ul { padding-left: 1.15rem; }

.prose ol {
  list-style: none;
  padding: 0;
  margin-top: 1.2em;
  counter-reset: steps;
  display: grid;
  gap: 0.65rem;
}

.prose ol > li {
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr);
  column-gap: 0.7rem;
  align-items: start;
  counter-increment: steps;
  line-height: 1.6;
}

.prose ol > li::before {
  content: counter(steps);
  font-size: 0.78em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.85;
}

.prose ul > li::marker { color: var(--ink-3); }

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

.prose ol > li + li { margin-top: 0; }

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.15rem 0 0.15rem 1.15rem;
  color: var(--ink);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4em 0;
}

.prose code {
  font-size: 0.9em;
  background: var(--paper-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.prose pre {
  background: var(--ink);
  color: var(--paper);
  padding: 0.9rem 1rem;
  border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.8125rem;
  max-width: 100%;
}

.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
  overflow-wrap: normal;
  white-space: pre;
}

.prose img {
  border-radius: 10px;
  margin: 1.25rem 0;
}

.prose figure { margin: 1.25rem 0; }

.prose figure.portrait img {
  max-width: min(100%, 22rem);
  margin-inline: auto;
}

.cta-band.article-cta {
  margin: 2.75rem 0 0;
}

.article-cta .cta-kicker,
.article-cta .cta-kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.article-cta p { max-width: 36rem; }

.related {
  margin-top: 2.5rem;
  padding-top: 0.25rem;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.back:hover { color: var(--ink); }

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 max(2.5rem, env(safe-area-inset-bottom, 0px));
  font-size: 0.875rem;
  color: var(--ink-3);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-bottom: 1.5rem;
}

.foot-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.foot-grid a { color: var(--ink-2); }
.foot-grid a:hover { color: var(--ink); }
.foot-grid ul { list-style: none; display: grid; }
.foot-grid li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.foot-grid h2 {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: var(--ink-3);
  font-weight: 600;
}

.foot-blurb {
  margin-top: 0.75rem;
  max-width: 24ch;
  line-height: 1.55;
}

.foot-social {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.95rem;
}

.foot-grid .foot-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--rule);
  color: var(--ink-3);
  background: var(--paper);
}

.foot-grid .foot-social a:hover {
  color: var(--accent);
  border-color: hsl(258, 40%, 78%);
  background: var(--accent-soft);
}

.foot-social svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.foot-base {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
}

@media (min-width: 360px) {
  .site-header .wrap { min-height: 58px; }
}

@media (min-width: 640px) {
  .nav a.nav-blog { display: inline-flex; }

  .featured-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "kicker meta"
      "title title"
      "excerpt excerpt";
  }
  .featured-inner .meta { justify-self: end; text-align: right; }

  .masthead {
    padding: clamp(2.75rem, 7vw, 4.5rem) 0 2.25rem;
  }
  .masthead h1 { font-size: clamp(2.5rem, 6vw, 3.5rem); }
  .masthead .dek { font-size: 1.125rem; }

  .featured { padding: clamp(2.25rem, 5vw, 3.5rem) 0; }
  .featured h2 { font-size: clamp(1.85rem, 3.5vw, 2.4rem); }

  .feed { padding: clamp(2.25rem, 5vw, 3.5rem) 0 1rem; }
  .feed-head {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
  }

  .prose {
    font-size: 1.125rem;
    line-height: 1.72;
  }
  .article-wrap { padding: clamp(1.75rem, 4vw, 2.85rem) 0 4.25rem; }

  .cta-band {
    padding: 1.6rem 1.4rem;
    margin: 2rem 0 2.5rem;
  }

  .cta-band.article-cta {
    margin: 2.75rem 0 0;
  }

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

@media (min-width: 760px) {
  .cta-band {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
  }

  .cta-actions {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 0 0 auto;
  }

  .cta-actions .btn { width: auto; }

  .cta-actions .btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--rule);
  }

  .cta-actions .btn-ghost .btn-beta {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .foot-base {
    flex-direction: row;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .list li { padding: 1.35rem 0; }

  .cta-band.article-cta {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (min-width: 900px) {
  .nav .hide-sm { display: inline-flex; }
  .site-header .wrap { min-height: 64px; }

  .nav a:not(.btn) {
    min-height: 0;
    padding: 0.4rem 0.75rem;
  }
}

@media (min-width: 1040px) {
  .masthead {
    padding: clamp(3rem, 8vw, 5.5rem) 0 2.5rem;
  }
  .masthead h1 { font-size: clamp(2.5rem, 6vw, 4rem); }

  .featured-inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    grid-template-areas:
      "kicker meta"
      "title meta"
      "excerpt meta";
    column-gap: clamp(1.5rem, 4vw, 3rem);
    row-gap: 0.5rem;
    align-items: end;
  }

  .featured-inner .meta {
    align-self: end;
    justify-self: start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .featured h2 {
    font-size: clamp(1.85rem, 3.5vw, 2.6rem);
    margin: 0.35rem 0 0.5rem;
  }

  .list li {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    grid-template-areas:
      "meta title"
      "meta excerpt";
    column-gap: 1.25rem;
    row-gap: 0.35rem;
    align-items: start;
  }

  .list .meta { padding-top: 0.2rem; flex-direction: column; gap: 0.15rem; }

  .foot-grid {
    grid-template-columns: 1.4fr 1fr 0.8fr;
    gap: 2rem;
    margin-bottom: 2rem;
  }

  .foot-cols { display: contents; }

  .foot-grid li a { min-height: 0; padding: 0.15rem 0; }

  .foot-grid .foot-social a {
    width: 36px;
    height: 36px;
  }
}

@media (min-width: 1024px) {
  .article-head {
    max-width: 52rem;
    padding-bottom: 2rem;
    margin-bottom: 2.35rem;
  }

  .article-layout {
    display: grid;
    grid-template-columns: minmax(0, 40.5rem) 14.75rem;
    justify-content: space-between;
    column-gap: clamp(1.75rem, 3vw, 3rem);
    align-items: start;
  }

  .article-main { max-width: 40.5rem; }

  .article-rail {
    display: block;
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 7rem);
    overflow: auto;
  }

  .prose {
    font-size: 1.125rem;
    line-height: 1.74;
  }
}

@media (min-width: 1180px) {
  .article-head { max-width: 56rem; }

  .article-layout {
    grid-template-columns: minmax(0, 45rem) 16.25rem;
    column-gap: clamp(2.5rem, 4vw, 4.75rem);
  }

  .article-main { max-width: 45rem; }

  .prose {
    font-size: 1.125rem;
    line-height: 1.74;
  }
}

@media (min-width: 1280px) {
  .prose {
    font-size: 1.1875rem;
    line-height: 1.74;
  }
}

@media (max-width: 359px) {
  .nav a.btn {
    font-size: 0.75rem;
    padding: 0.45rem 0.8rem;
  }
}
