/* Site 4 — "technical blueprint"
   Reference lock: SST (sst.dev) as the primary direction — bright white canvas,
   a bold monospaced voice for display type, very light gray dividers, faint
   surfaces instead of shadows, and the calm of a well-typeset technical
   document rather than a marketing page.
   Borrowed only from Hashnode: the single electric indigo reserved for primary
   interactive emphasis and active states, nothing else.
   Rejected: serif display type (owned by sites 1 and 3), parchment, any second
   accent, decorative gradients.

   The monospaced headline is the signature and must survive. It is what makes
   this publication legible as the tools title at a glance. */

:root {
  --white: #ffffff;
  --mist: #fafafa;
  --surface: #f4f4f5;
  --ink: #18181b;
  --slate: #3f3f46;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --indigo: #4f46e5;   /* interactive emphasis and active states only */

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Inter, system-ui, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 36rem;
  --wide: 74rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 48em) { body { font-size: 1.125rem; line-height: 1.68; } }

img { max-width: 100%; height: auto; display: block; border-radius: 4px; }

a { color: inherit; text-decoration: underline; text-underline-offset: .18em;
    text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); }
a:hover { color: var(--indigo); text-decoration-color: var(--indigo); }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; background: var(--ink); color: #fff; padding: .75rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

.shell { max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }

/* ---- Masthead ---------------------------------------------------------- */

.masthead { border-bottom: 1px solid var(--line); background: var(--white);
            position: sticky; top: 0; z-index: 5; }
.masthead-inner { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
                  align-items: center; justify-content: space-between; padding-block: .9rem; }
.wordmark { font-family: var(--mono); font-weight: 700; font-size: 1.0625rem;
            letter-spacing: -0.03em; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .875rem; }
.nav a { text-decoration: none; color: var(--slate); }
.nav a:hover { color: var(--indigo); }

/* ---- Home -------------------------------------------------------------- */

.intro { padding-block: clamp(2.5rem, 7vw, 5rem) 1.5rem; }
.intro-title { font-family: var(--mono); font-size: clamp(1.75rem, 4.4vw, 2.9rem);
               line-height: 1.14; font-weight: 700; letter-spacing: -0.04em;
               margin: 0 0 1rem; max-width: 22ch; text-wrap: balance; }
.intro-dek { margin: 0; max-width: 52ch; color: var(--slate); }

.lead-story { padding: clamp(1.5rem, 3.5vw, 2.25rem); background: var(--mist);
              border: 1px solid var(--line); border-radius: 4px;
              margin-block: clamp(1.5rem, 4vw, 2.5rem); }
.lead-title { font-family: var(--mono); font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2;
              font-weight: 700; letter-spacing: -0.035em; margin: .5rem 0 .5rem; text-wrap: balance; }
.lead-title a { text-decoration: none; }
.lead-title a:hover { text-decoration: underline; text-underline-offset: .16em; }
.lead-dek { margin: 0 0 .6rem; max-width: 56ch; color: var(--slate); }

.kicker { font-family: var(--mono); font-size: .75rem; letter-spacing: -0.01em;
          color: var(--muted); margin: 0; }
.kicker a { text-decoration: none; }
.kicker a::before { content: "# "; color: var(--line-strong); }
.meta { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin: 0; }
.section-label { font-family: var(--mono); font-size: .75rem; letter-spacing: -0.01em;
                 color: var(--muted); font-weight: 400; margin: 0 0 1.25rem;
                 padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.stream, .topics { padding-block: clamp(2rem, 5vw, 3.25rem); }

.card-grid { display: grid; gap: 1.5rem; }
@media (min-width: 42em) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 66em) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card { border: 1px solid var(--line); border-radius: 4px; padding: 1.15rem;
        background: var(--white); }
.card:hover { border-color: var(--line-strong); }
.card-media { display: block; margin: -1.15rem -1.15rem .9rem; }
.card-media img { aspect-ratio: 16/9; object-fit: cover; border-radius: 4px 4px 0 0; }
.card-title { font-family: var(--mono); font-size: 1.0625rem; line-height: 1.3; font-weight: 700;
              letter-spacing: -0.03em; margin: .4rem 0 .4rem; text-wrap: balance; }
.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--indigo); }
.card-dek { margin: 0 0 .5rem; font-size: .9375rem; color: var(--slate); }

.more { margin-top: 1.75rem; font-size: .9rem; }
.more a { color: var(--indigo); }
.topic-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
@media (min-width: 44em) { .topic-list { grid-template-columns: repeat(2, 1fr); gap: .4rem 2rem; } }
.topic-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
                 padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.topic-list a { text-decoration: none; font-family: var(--mono); letter-spacing: -0.02em; }
.count { font-family: var(--mono); font-size: .75rem; color: var(--muted);
         font-variant-numeric: tabular-nums; }

/* ---- Article ----------------------------------------------------------- */

.post { max-width: var(--measure); margin-inline: auto;
        padding-inline: var(--gutter); padding-block: clamp(1.75rem, 4vw, 3rem) 0; }
.is-post main { padding-bottom: clamp(3rem, 6vw, 4.5rem); }

.crumbs { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin-bottom: 1.5rem; }
.crumbs a { text-decoration: none; }

.post-head h1 { font-family: var(--mono); font-size: clamp(1.7rem, 4.6vw, 2.5rem);
                line-height: 1.16; font-weight: 700; letter-spacing: -0.04em;
                margin: 0 0 .75rem; text-wrap: balance; }
.dek { font-size: 1.075em; color: var(--slate); margin: 0 0 1.1rem;
       line-height: 1.5; text-wrap: pretty; }
.byline { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin: 0;
          padding-bottom: 1.15rem; border-bottom: 1px solid var(--line); }
.byline .author { color: var(--ink); }
.sep { margin-inline: .4rem; }

.lede { margin: 1.75rem 0 2.25rem; }
.lede img { aspect-ratio: 16/9; object-fit: cover; }
figcaption, .credit { font-family: var(--mono); font-size: .7rem; color: var(--muted);
                      margin-top: .45rem; line-height: 1.5; }

.toc { background: var(--mist); border: 1px solid var(--line); border-radius: 4px;
       padding: 1rem 1.15rem; margin-bottom: 2.25rem; }
.toc-label { font-family: var(--mono); font-size: .7rem; color: var(--muted); margin: 0 0 .5rem; }
.toc ol { margin: 0; padding-left: 1.1rem; font-size: .9375rem; }
.toc li { margin-bottom: .3rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.prose p { margin: 0 0 1.3em; text-wrap: pretty; }
.prose h2 { font-family: var(--mono); font-size: clamp(1.2rem, 2.6vw, 1.45rem); line-height: 1.28;
            font-weight: 700; letter-spacing: -0.035em; margin: 2.5em 0 .7em; text-wrap: balance; }
.prose h2::before { content: "// "; color: var(--line-strong); font-weight: 400; }
.prose h3 { font-family: var(--mono); font-size: 1em; font-weight: 700;
            letter-spacing: -0.03em; margin: 1.9em 0 .5em; }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 600; }

.prose blockquote { margin: 2em 0; padding: 1rem 1.15rem; background: var(--mist);
                    border: 1px solid var(--line); border-radius: 4px; font-size: 1em; }
.prose blockquote p:last-child { margin-bottom: 0; }

.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 2em 0;
               font-size: .875rem; line-height: 1.45; }
.prose table :is(th, td) { text-align: left; padding: .65rem .75rem; border: 1px solid var(--line);
                           vertical-align: top; }
.prose th { font-family: var(--mono); font-weight: 700; font-size: .8125rem;
            letter-spacing: -0.02em; background: var(--surface); }
.prose figure { margin: 2em 0; }
.prose code { font-family: var(--mono); font-size: .875em; background: var(--surface);
              padding: .12em .35em; border-radius: 3px; }
.prose pre { background: var(--surface); padding: 1rem; overflow-x: auto; border-radius: 4px;
             font-size: .8125rem; line-height: 1.55; border: 1px solid var(--line); }
.prose pre code { background: none; padding: 0; }

.faq { max-width: var(--measure); margin: 2.75rem auto 0; padding-inline: var(--gutter); }
.faq h2 { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.035em;
          margin: 0 0 .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.faq dt { font-weight: 600; margin-top: 1.15rem; }
.faq dd { margin: .3rem 0 0; color: var(--slate); }

.post-foot { margin-top: 2.5rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.author-note, .disclosure-note { font-family: var(--mono); font-size: .75rem; color: var(--muted);
                                 line-height: 1.6; margin: 0 0 .45rem; }

.related { max-width: var(--wide); margin: clamp(2.5rem, 6vw, 4rem) auto 0;
           padding-inline: var(--gutter); border-top: 1px solid var(--line); padding-top: 2rem; }
.related h2 { font-family: var(--mono); font-size: .75rem; color: var(--muted); font-weight: 400;
              margin: 0 0 1.25rem; }

/* ---- Lists and footer -------------------------------------------------- */

.list-head { padding-block: clamp(2rem, 5vw, 3.25rem) 1.5rem; }
.list-head h1 { font-family: var(--mono); font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700;
                letter-spacing: -0.04em; margin: .25rem 0 .4rem; }
.year { margin-bottom: 2.5rem; }
.year-label { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin: 0 0 .6rem;
              padding-bottom: .4rem; border-bottom: 1px solid var(--line-strong);
              font-variant-numeric: tabular-nums; }
.index-list { list-style: none; margin: 0; padding: 0; }
.index-list li { display: flex; flex-wrap: wrap; gap: .2rem 1rem; justify-content: space-between;
                 align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.index-list a { text-decoration: none; }
.index-list time { font-family: var(--mono); font-size: .75rem; color: var(--muted);
                   white-space: nowrap; font-variant-numeric: tabular-nums; }

.site-footer { margin-top: clamp(2.5rem, 6vw, 4rem); border-top: 1px solid var(--line);
               padding-block: 2rem 3rem; background: var(--mist); }
.footer-line { margin: 0 0 .6rem; font-family: var(--mono); letter-spacing: -0.02em; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .875rem; margin-bottom: .85rem; }
.footer-fine { font-family: var(--mono); font-size: .7rem; color: var(--muted); margin: 0; }

/* ---- Topic cluster ------------------------------------------------------
   A cluster article points up to its pillar; the pillar lists the whole set.
   Both directions are load-bearing: the reader gets a way through the subject
   and the subject reads as one body of work rather than scattered posts. */

.series-up {
  font-family: var(--mono); font-size: .8125rem; color: var(--muted);
  margin: 0 0 1.5rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line);
}
.series {
  margin: 2.75rem 0 0; padding: 0 0 1.25rem; border-top: 2px solid var(--line-strong);
  background: var(--mist); padding-inline: 1.25rem; border-radius: 4px;
}
.series h2 {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 1.25rem 0 1rem;
}
.series-list { margin: 0; padding-left: 1.25rem; }
.series-list li { margin-bottom: .9rem; }
.series-list a { text-decoration: none; font-weight: 500; }
.series-list a:hover { text-decoration: underline; text-underline-offset: .16em; }
.series-dek {
  display: block; font-family: var(--mono); font-size: .8125rem; line-height: 1.5;
  color: var(--slate); margin-top: .15rem;
}
.checked { font-family: var(--mono); font-size: .78rem; color: var(--muted); margin: 0 0 .5rem; }
