html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 8%, rgba(0, 200, 140, 0.08), transparent 30rem),
    var(--ground);
  line-height: 1.65;
}

.meta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.eyebrow { letter-spacing: 1.8px; }
.meta { color: var(--faint); }

/* Blog overview */
.blog-hero { padding: 76px 0 50px; border-bottom: 1px solid var(--hairline); }
.blog-hero h1 {
  max-width: 760px;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -1.7px;
}
.blog-hero h1 span { color: var(--accent); }
.blog-hero .lede {
  max-width: 58ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
}
.posts { padding: 54px 0 0; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.section-head h2 { font-size: 26px; font-weight: 800; }
.section-head p { margin: 0; color: var(--faint); font-family: var(--mono); font-size: 12px; }
.post-card {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  overflow: hidden;
  color: inherit;
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: 0 24px 60px -36px rgba(37, 57, 43, 0.22);
  transition: border-color 140ms ease, transform 140ms ease;
}
.post-card:hover { border-color: #2B5540; text-decoration: none; transform: translateY(-2px); }
.post-visual {
  overflow: hidden;
  background: #f3f9f5;
  border-right: 1px solid var(--hairline);
}
.post-image { width: 100%; height: auto; display: block; aspect-ratio: 1; object-fit: cover; }
.post-copy { padding: 46px 46px 42px; display: flex; flex-direction: column; }
.post-copy .meta { color: var(--accent); }
.post-copy h2 {
  margin-top: 16px;
  font-size: clamp(27px, 3.6vw, 38px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.8px;
}
.post-copy .dek { margin: 18px 0 0; color: var(--muted); font-size: 16px; }
.post-copy .read { margin-top: auto; padding-top: 28px; font-family: var(--mono); font-size: 12px; color: var(--accent); }
.prose ul { margin: 0 0 27px; padding-left: 23px; color: var(--muted); }
.prose li { margin-bottom: 12px; }
.series-links {
  margin-top: 0;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.series-links h2 { padding: 0; margin-top: 0; font-size: 25px; }
.series-links p:last-child { margin-bottom: 0; }

/* Article */
.back { display: inline-block; margin-top: 38px; font-family: var(--mono); font-size: 12px; }
.article-head { grid-area: head; padding: 36px 0 24px; }
.article-head h1 {
  font-size: clamp(38px, 5.5vw, 60px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -1.8px;
}
.article-head .dek {
  max-width: 68ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
}
.byline { margin-top: 26px; color: var(--faint); font-size: 13px; }
.article-rule {
  grid-area: rule;
  width: 100%;
  margin: 0 0 20px;
  border: 0;
  border-top: 1px solid var(--hairline);
}
.article-layout {
  display: grid;
  max-width: 1128px;
  grid-template-columns: minmax(0, 800px) clamp(240px, 22vw, 280px);
  grid-template-areas:
    "head ."
    "rule ."
    "body toc"
    "related related";
  column-gap: clamp(24px, 4vw, 48px);
}
.prose { grid-area: body; min-width: 0; }
.prose > .article-figure:first-child { max-width: none; margin: 0 0 24px; }
.prose img, .prose video { max-width: 100%; height: auto; }
.article-sidebar {
  grid-area: toc;
  min-width: 0;
}
.article-end-video iframe {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
}
.article-toc {
  display: block;
  z-index: auto;
  align-self: start;
  min-width: 0;
  padding: 16px 14px 16px 18px;
  border: 0;
  border-left: 1px solid var(--hairline);
}
nav.article-toc,
.article-toc > nav { display: block; }
.article-toc h2 {
  margin: 0 0 10px;
  font-size: 16px;
}
.article-toc ul,
.article-related ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.article-toc nav a,
nav.article-toc a {
  display: block;
  padding: 5px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.article-toc a:is(:hover, :focus-visible) { color: var(--accent); }
@media (min-width: 881px) {
  .article-toc {
    position: sticky;
    top: var(--sticky-nav-offset);
    max-height: calc(100dvh - var(--sticky-nav-offset) - 16px);
    overflow-y: auto;
  }
}
.article-toc-subheading { padding-inline-start: 14px; }
.article-related {
  grid-area: related;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}
.article-related h2 { margin: 0 0 16px; font-size: 26px; }
.article-related ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}
.article-related li { display: flex; }
.article-related a {
  flex: 1;
  display: block;
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 9px;
  font-weight: 600;
}
.article-related img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: contain;
  background: var(--panel-2);
  border-bottom: 1px solid var(--hairline);
}
.article-related a span {
  display: block;
  padding: 14px 16px;
}
.article-related a:is(:hover, :focus-visible) { border-color: var(--accent); }

.article-video {
  max-width: 520px;
  margin: 24px 0;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: var(--panel);
  font-size: 14px;
}
.article-toc .article-video { margin: 16px 0 0; }
.prose .article-video h2,
.article-video h2 {
  margin: 0 0 8px;
  padding: 0;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: normal;
}
.article-video p { margin: 0 0 10px; color: var(--muted); }
.article-video-link { display: grid; gap: 8px; font-weight: 600; }
.article-video-thumbnail {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 5px;
  background: var(--panel-2);
}
.article-video-thumbnail img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-video-play {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ground);
}
.article-video-play svg { width: 16px; height: 16px; }

@media (max-width: 880px) {
  .article-video-link {
    grid-template-columns: minmax(0, 120px) 1fr;
    align-items: center;
    gap: 12px;
  }
  .article-layout {
    grid-template-columns: minmax(0, 800px);
    grid-template-areas: "head" "rule" "toc" "body" "related";
  }
  .article-toc {
    margin-bottom: 24px;
    background: var(--panel);
  }
}
.prose > p:first-child { margin-top: 0; font-weight: 400; }
.prose p { margin: 0 0 23px; color: var(--muted); }
.prose h2 {
  padding-top: 34px;
  margin: 24px 0 18px;
  font-size: clamp(27px, 4vw, 36px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.6px;
}
.prose .series-links h2 { margin-top: 0; padding-top: 0; }
.prose h3 { margin: 30px 0 12px; font-size: 19px; font-weight: 600; }
.prose strong { color: var(--ink); font-weight: 600; }
.article-figure { margin: 34px 0 42px; }
.article-figure--narrow { max-width: 720px; margin-right: auto; margin-left: auto; }
.article-figure img,
.article-figure video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.jump-links {
  margin: 30px 0 38px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
}
.jump-links p { margin: 0 0 10px; color: var(--muted); }
.jump-links .jump-row { display: block; }
.jump-links strong { color: var(--ink); }
.inline-cta {
  margin: 34px 0;
  padding: 25px 27px;
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: 9px;
}
.inline-cta p { margin: 0; }
.inline-cta p + p { margin-top: 16px; }
.install-cta {
  margin: 34px 0;
  padding: 25px 27px;
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  border: 1px solid var(--hairline);
  border-radius: 9px;
}
.install-cta > p { margin: 0; }
.install-cta .install-line { margin: 18px 0 14px; }
.install-line {
  width: 500px;
  max-width: 100%;
  margin: 26px 0 32px;
  padding: 12px 15px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink);
  background: #f3f9f5;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
}
/* The command scrolls, the copy button stays put. min-width:0 lets the code
   element shrink past its min-content width so its own overflow-x engages;
   without it a flex item defaults to min-width:auto and overflows the row. */
.install-line code { overflow-x: auto; min-width: 0; white-space: nowrap; color: var(--ink); font-family: inherit; }
.install-line .dollar { margin-right: 9px; color: var(--accent); }
.copy-button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--on-action);
  background: var(--action);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.copy-button:hover { background: var(--lime); }
.copy-button svg { width: 17px; height: 17px; }
.copy-button .copy-done { display: none; font-size: 18px; font-weight: 800; }
.copy-button.copied .copy-icon { display: none; }
.copy-button.copied .copy-done { display: inline; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.closing-card {
  margin-top: 58px;
  padding: 38px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}
.closing-card h2 { padding: 0; margin: 0; font-size: 27px; }
.closing-card p { margin: 12px 0 0; }

footer {
  margin-top: 82px;
}

@media (max-width: 880px) {
  .post-card { grid-template-columns: 1fr; }
  .post-visual { border-right: 0; border-bottom: 1px solid var(--hairline); }
}

@media (max-width: 600px) {
  nav { flex-wrap: wrap; row-gap: 10px; align-items: flex-start; }
  nav .links { margin-left: 0; flex-basis: 100%; gap: 14px 18px; }
  .blog-hero { padding-top: 54px; }
  .post-copy { padding: 30px 26px; }
  .article-head { padding-top: 28px; }
  .closing-card { padding: 28px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
