/* The Journal: note page template (Figma frame "inner 3"). Every note uses it. Loads after base.css. */

:root { --maxw: 1280px; --pad: 80px; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--pad) * 2);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- blog nav (same as The Journal home) ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(12, 15, 20, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav__bar { height: 64px; display: flex; align-items: center; gap: 32px; }
.logo--blog .logo__name { letter-spacing: -0.01em; }
.logo__sub { font: 500 14px/normal var(--f-body); color: var(--ink-2); white-space: nowrap; }
.nav__links { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.nav__links a { font: 500 14px/normal var(--f-body); color: var(--ink-3); white-space: nowrap; transition: color .16s ease-out; }
.nav__links a[aria-current] { color: var(--ink); }
.search-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 10px 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-btn);
  transition: border-color .16s ease-out, background-color .16s ease-out;
}
.search-btn kbd { padding: 2px 6px; border-radius: 4px; background: var(--bg-3); font-size: 11px; line-height: normal; color: var(--ink-3); }
.nav__panel { border-top: 1px solid var(--line); padding-block: 8px 20px; }
.nav__panel nav { display: flex; flex-direction: column; margin-bottom: 16px; }
.nav__panel nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font: 500 16px/normal var(--f-body); color: var(--ink-3); }
.nav__panel nav a[aria-current] { color: var(--ink); }

/* ---------- note header ---------- */
.note-head {
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding-top: 56px; padding-bottom: 40px;
  text-align: center;
}
.crumbs {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px;
  font: 500 12px/normal var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.crumbs a:first-child { color: var(--ink-2); text-transform: none; }
.crumbs a.crumbs__topic { color: var(--accent); }
.crumbs span:last-child { text-transform: none; }
.note-head__title {
  max-width: 1000px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(32px, 4.6vw + 12px, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.note-head__lede {
  max-width: 760px;
  font: 400 20px/1.5 var(--f-body);
  color: var(--ink-2);
  text-wrap: pretty;
}
.byline {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px;
  padding-top: 6px;
  text-align: left;
}
.byline__who { display: flex; align-items: center; gap: 14px; }
.avatar {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  font: 500 12px/normal var(--f-mono);
}
.byline__name { font: 500 15px/normal var(--f-body); color: var(--ink); }
.byline__meta { margin-top: 2px; font: 400 11px/normal var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.byline__rule { width: 1px; height: 28px; background: var(--line); }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.tags li {
  padding: 5px 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font: 400 11px/normal var(--f-mono);
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

/* ---------- hero illustration ---------- */
.note-hero { padding-top: 8px; }
.note-hero img {
  width: 100%; height: auto;
  aspect-ratio: 1280 / 520;
  object-fit: cover;
  border-radius: var(--r-lg);
  background: #2466c9;
}

/* ---------- layout: share | article | rail ---------- */
.note-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 720px) 280px;
  justify-content: center;
  column-gap: 60px;
  align-items: start;
  padding-top: 64px;
  padding-bottom: 96px;
}
.rail-label {
  font: 500 11px/normal var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.share {
  position: sticky; top: calc(64px + 24px + env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; gap: 10px;
}
.share__btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  font: 500 13px/normal var(--f-body);
  color: var(--ink-2);
  white-space: nowrap;
  transition: border-color .16s ease-out, color .16s ease-out;
}
.share__icon { color: var(--ink-3); }

/* ---------- article blocks ---------- */
.prose { display: flex; flex-direction: column; gap: 22px; min-width: 0; outline: none; }
.prose > p { font: 400 18px/1.7 var(--f-body); color: var(--ink-2); text-wrap: pretty; }
.prose :not(pre) > code { font-size: 15px; color: var(--ink); }
.prose :is(p, li, dd) a:not([class]) {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 3px;
  transition: text-decoration-color .16s ease-out;
}
.prose strong { font-weight: 600; color: var(--ink); }

/* lists inside the article: numbered for console steps, dotted for plain lists */
.prose > ol, .prose > ul { display: flex; flex-direction: column; gap: 12px; }
.prose > ol > li, .prose > ul > li {
  position: relative;
  font: 400 18px/1.65 var(--f-body);
  color: var(--ink-2);
  text-wrap: pretty;
}
.prose > ol > li { padding-left: 42px; }
.prose > ol > li::before {
  content: counter(list-item, decimal-leading-zero);
  position: absolute; left: 0; top: 3px;
  display: grid; place-items: center;
  width: 28px; height: 22px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font: 500 11px/1 var(--f-mono);
  color: var(--ink-2);
}
.prose > ul > li { padding-left: 24px; }
.prose > ul > li::before,
.prose li > ul > li::before {
  content: "";
  position: absolute; left: 6px; top: 0.72em;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent);
}
.prose li > ul { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.prose li > ul > li { position: relative; padding-left: 22px; font-size: 16px; }

/* small label inside a step (e.g. "Example: …") */
.prose__minor {
  padding-top: 4px;
  font: 500 12px/normal var(--f-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

/* table (plans, sizes) */
.table {
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  /* edge shading appears only while there is more table to scroll to */
  background:
    linear-gradient(90deg, var(--bg) 30%, rgba(12, 15, 20, 0)) left / 32px 100% no-repeat local,
    linear-gradient(270deg, var(--bg) 30%, rgba(12, 15, 20, 0)) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(245, 239, 228, 0.1), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(245, 239, 228, 0.1), transparent) right / 12px 100% no-repeat scroll;
}
.table:focus-visible { outline-offset: 2px; border-radius: var(--r-md); }
.table table { width: 100%; min-width: 520px; border-collapse: collapse; }
.table th {
  padding: 11px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  font: 500 11px/normal var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  font: 400 14px/1.45 var(--f-body);
  color: var(--ink-2);
  white-space: nowrap;
}
.table tr + tr td { border-top: 1px solid var(--line); }
.table td:first-child { font-weight: 600; color: var(--ink); }
.table td.num { font: 400 13px/1.45 var(--f-mono); font-variant-numeric: tabular-nums; }
.table td.free { color: var(--accent-2); }

.checklist a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; transition: text-decoration-color .16s ease-out; }
.checklist code { font-size: 14px; }
.callout a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* checklist */
.checklist {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px 22px 22px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  scroll-margin-top: 96px;
}
.checklist__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.checklist__title { font: 500 11px/normal var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); }
.checklist__aside { font: 400 11px/normal var(--f-mono); color: var(--ink-3); white-space: nowrap; }
.checklist ul { display: flex; flex-direction: column; gap: 12px; }
/* check sits outside the text flow so links and code inside an item wrap normally */
.checklist li {
  position: relative;
  padding-left: 30px;
  font: 400 16px/1.5 var(--f-body);
  color: var(--ink);
  text-wrap: pretty;
}
.checklist li::before {
  content: "";
  position: absolute; left: 0; top: 3px;
  width: 18px; height: 18px;
  border-radius: 4px;
  background: var(--accent-2) url("../icons/check.svg") center / 12px 12px no-repeat;
}

/* step heading */
.step { display: flex; flex-direction: column; gap: 12px; padding-top: 32px; scroll-margin-top: 64px; }
.step__label {
  display: flex; align-items: center; gap: 10px;
  font: 500 12px/normal var(--f-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.step__label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
.step__title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

/* repo card */
.repo {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  transition: border-color .16s ease-out;
}
.repo img { flex: none; }
.repo__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: normal; }
.repo__name { font-family: var(--f-mono); font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo__desc { color: var(--ink-3); }
.repo__go { font: 500 14px/normal var(--f-body); color: var(--accent); white-space: nowrap; }

/* callouts */
.callout {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 20px 16px 40px;
  border: 1px solid var(--edge);
  border-radius: var(--r-md);
  background: var(--tint) var(--dot) 18px 16px / 8px 13px no-repeat;
}
.callout--lime { --tint: var(--accent-2-tint); --edge: var(--accent-2-edge); --tone: var(--accent-2); --dot: url("../icons/callout-lime.svg"); }
.callout--orange { --tint: var(--accent-3-tint); --edge: var(--accent-3-edge); --tone: var(--accent-3); --dot: url("../icons/callout-orange.svg"); }
.callout__label { font: 500 11px/normal var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tone); }
.callout p:last-child { font: 400 16px/1.6 var(--f-body); color: var(--ink); }

/* code block (Figma component "code block") */
.code {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  min-width: 0;
}
.code__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 14px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
}
.code__dots { display: flex; gap: 8px; }
.code__dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.code__dots i:nth-child(2) { background: #febc2e; }
.code__dots i:nth-child(3) { background: #28c840; }
.code__title { flex: 1; min-width: 0; text-align: center; font: 400 11px/normal var(--f-mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code--output .code__bar { padding-right: 14px; }
.code--output .code__title { padding-right: 46px; }
.code--output .code__body { color: var(--ink-2); }
.code__copy {
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font: 500 11px/normal var(--f-mono);
  color: var(--ink-2);
  min-width: 52px;
  transition: border-color .16s ease-out, color .16s ease-out, transform .16s ease-out;
}
.code__copy span { display: inline-block; }
.code__copy:active { transform: scale(.97); }
.code__copy.is-done { color: var(--accent-2); }
.code__body {
  margin: 0;
  padding: 16px 18px 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre;
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

/* sub-heading inside a step (Troubleshooting) */
.prose__sub { padding-top: 8px; font: 700 22px/1.2 var(--f-display); letter-spacing: -0.01em; color: var(--ink); }

/* screenshot */
.shot { position: relative; margin: 0; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.shot img { width: 100%; height: auto; }
.shot.is-missing { min-height: 180px; display: grid; place-items: center; }
.shot.is-missing img { display: none; }
.shot.is-missing::after { content: "Screenshot: " attr(data-label); font: 400 12px/normal var(--f-mono); color: var(--ink-3); }

/* definitions table */
.defs { margin: 0; border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; }
.defs > div { display: flex; gap: 18px; padding: 13px 18px; }
.defs > div + div { border-top: 1px solid var(--line); }
.defs dt { flex: none; width: 230px; font: 500 13px/normal var(--f-mono); color: var(--ink); padding-top: 2px; }
.defs dd { flex: 1; min-width: 0; margin: 0; font: 400 15px/1.55 var(--f-body); color: var(--ink-2); }
.defs dd code { font-size: 13px; color: var(--ink); }
.defs--issues dt { width: 200px; padding-top: 0; font: 500 15px/1.55 var(--f-body); }
.defs--issues dt code { font-size: 13px; }
/* stacked: long terms (error messages) sit above their fix */
.defs--stack > div { flex-direction: column; gap: 6px; }
.defs--stack dt { width: auto; padding-top: 0; line-height: 1.5; }

/* ---------- rail: contents + follow along ---------- */
.rail {
  position: sticky; top: calc(64px + 24px + env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; gap: 18px;
  min-width: 0;
}
.toc {
  padding: 18px 0 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.toc__head {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 18px 10px;
  cursor: default;
  text-align: left;
}
.toc__count { font: 400 11px/normal var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.toc__list a {
  display: grid; grid-template-columns: 2px 14px minmax(0, 1fr); align-items: start; gap: 12px;
  padding: 9px 18px;
  font: 400 14px/normal var(--f-body);
  color: var(--ink-2);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
  transition: color .16s ease-out, background-color .16s ease-out;
}
.toc__list i { flex: none; width: 2px; height: 18px; background: var(--line); transition: background-color .16s ease-out; }
.toc__n { flex: none; width: 14px; font: 400 11px/normal var(--f-mono); color: var(--ink-3); }
.toc__list a.is-read { color: var(--ink-3); }
.toc__list a.is-active { background: var(--bg-3); color: var(--ink); font-weight: 500; }
.toc__list a.is-active i { background: var(--accent); }
.toc__list a.is-active .toc__n { color: var(--accent); }
.toc__list a.is-pending { cursor: default; }
.toc__list a:focus-visible { outline-offset: -2px; border-radius: 0; }
.progress { display: flex; flex-direction: column; gap: 8px; padding: 12px 18px 6px; }
.progress__row { display: flex; justify-content: space-between; font: 400 10px/normal var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.progress__row span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.progress__track { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress__track span { display: block; height: 100%; border-radius: 2px; background: var(--accent); transform-origin: left center; transform: scaleX(0); }

.follow {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 18px;
  background: var(--cream);
  border-radius: var(--r-lg);
}
.follow__label { font: 500 11px/normal var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--cream-ink-2); }
.follow__title { font: 700 20px/1.18 var(--f-display); color: var(--cream-ink); text-wrap: balance; }
.follow__btn {
  display: inline-flex; padding: 10px 16px;
  background: var(--accent); color: var(--bg);
  border-radius: var(--r-btn);
  font: 500 14px/normal var(--f-body);
  transition: transform .16s ease-out, background-color .16s ease-out;
}
.follow__btn:active { transform: scale(.97); }
.follow__btn:focus-visible { outline-color: var(--cream-ink); }

/* ---------- related builds ---------- */
.related {
  display: flex; flex-direction: column; gap: 14px;
  padding-top: 56px; padding-bottom: 72px;
  border-top: 1px solid var(--line);
  max-width: none;
}
.related > * { width: 100%; max-width: var(--maxw); margin-inline: auto; }
.related__title { font: 800 36px/normal var(--f-display); letter-spacing: -0.015em; color: var(--ink); }
.related__row {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 20px 12px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color .16s ease-out, background-color .16s ease-out;
}
.related__row img { flex: none; width: 140px; height: 84px; border-radius: var(--r-btn); object-fit: cover; }
.related__name { flex: 1; min-width: 0; font: 600 20px/normal var(--f-display); color: var(--ink); }
.related__meta { font: 400 11px/normal var(--f-mono); letter-spacing: 0.06em; color: var(--ink-3); white-space: nowrap; }
.related__arr { font: 500 14px/normal var(--f-mono); color: var(--ink-2); }

/* ---------- footer (same as The Journal home) ---------- */
.footer { padding-top: 56px; }
.eyebrow { display: flex; align-items: center; gap: 12px; font: 500 12px/normal var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--dash, var(--accent)); flex: none; }
.eyebrow--sky { --dash: var(--accent); }
.subscribe {
  display: flex; align-items: center; gap: 64px;
  padding: 48px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
}
.subscribe__copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.subscribe__copy h2 { font: 800 40px/1.02 var(--f-display); letter-spacing: -0.02em; color: var(--ink); }
.subscribe__copy p:last-child { font: 400 16px/normal var(--f-body); color: var(--ink-2); }
.subscribe__actions { flex: 0 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.term { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 18px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-md); }
.term__prompt { font: 400 14px/normal var(--f-mono); color: var(--accent-2); }
.term__cmd { flex: 1; min-width: 0; font: 400 14px/normal var(--f-mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term__copy {
  flex: none; padding: 10px 14px;
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font: 500 12px/normal var(--f-mono); color: var(--ink);
  transition: transform .16s ease-out, border-color .16s ease-out, color .16s ease-out;
}
.term__copy:active { transform: scale(.97); }
.term__copy.is-done { color: var(--accent-2); }
.help { display: flex; flex-wrap: wrap; gap: 8px 20px; font: 400 14px/normal var(--f-body); }
.help span { color: var(--ink-3); }
.help a { font-weight: 500; color: var(--ink-2); transition: color .16s ease-out; }
.help a.help__discord { color: var(--accent); }
.site-foot { display: flex; align-items: flex-start; gap: 56px; padding-top: 72px; padding-bottom: 50px; }
.site-foot__brand { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.site-foot__brand p { font: 400 14px/normal var(--f-body); color: var(--ink-3); }
.site-foot__col { width: 160px; flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.site-foot__col h3 { font: 500 11px/normal var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.site-foot__col a { font: 400 14px/normal var(--f-body); color: var(--ink-2); transition: color .16s ease-out; }

/* ---------- search dialog (same as The Journal home) ---------- */
.search { width: min(560px, calc(100% - 32px)); max-width: none; max-height: min(560px, 76vh); margin: 12vh auto auto; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.search::backdrop { background: rgba(12, 15, 20, 0.64); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.search__panel { display: flex; flex-direction: column; max-height: inherit; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5); overflow: hidden; }
.search__bar { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); }
.search__bar input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font: 400 16px/normal var(--f-body); color: var(--ink); }
.search__bar input::placeholder { color: var(--ink-3); }
.search__bar input::-webkit-search-cancel-button { display: none; }
.search__bar kbd { padding: 3px 6px; border-radius: 4px; background: var(--bg-3); font-size: 11px; color: var(--ink-3); }
.search__results { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.search__results a { display: grid; gap: 6px; padding: 12px; border-radius: var(--r-btn); outline: none; }
.search__results a:focus-visible { background: var(--bg-3); }
.result__cat { display: inline-flex; align-items: center; gap: 8px; font: 500 10px/normal var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.result__cat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot); }
[data-cat="deployment"] { --dot: var(--accent); }
[data-cat="database"] { --dot: var(--accent-2); }
[data-cat="vm"] { --dot: var(--accent-3); }
.result__title { font: 500 15px/1.35 var(--f-body); color: var(--ink); }
.result__meta { font: 400 11px/normal var(--f-mono); color: var(--ink-3); }
.search__empty { padding: 20px 18px 24px; font: 400 14px/normal var(--f-body); color: var(--ink-3); }

/* ---------- hover (only where hover is real) ---------- */
@media (hover: hover) {
  .nav__links a:hover { color: var(--ink-2); }
  .nav__links a[aria-current]:hover { color: var(--ink); }
  .search-btn:hover { border-color: var(--line-3); background: var(--bg-2); }
  .crumbs a:hover { color: var(--ink); }
  .crumbs a.crumbs__topic:hover { color: #8fd6ff; }
  .share__btn:hover { border-color: var(--line-2); color: var(--ink); }
  .prose :is(p, li, dd) a:not([class]):hover, .checklist a:hover { text-decoration-color: var(--ink-2); }
  .repo:hover { border-color: var(--line-3); }
  .code__copy:hover { border-color: var(--line-3); color: var(--ink); }
  .toc__list a:not(.is-pending):not(.is-active):hover { color: var(--ink); }
  .follow__btn:hover { background: #7bcfff; }
  .related__row:hover { border-color: var(--line-2); background: var(--bg-3); }
  .related__row:hover .related__arr { transform: translateX(3px); }
  .term__copy:hover { border-color: var(--line-3); }
  .help a:hover { color: var(--ink); }
  .help a.help__discord:hover { color: #8fd6ff; }
  .site-foot__col a:hover { color: var(--ink); }
  .search__results a:hover { background: var(--bg-3); }
}

/* ---------- responsive ---------- */

/* laptop: share rail folds into a row under the article */
@media (max-width: 1279px) {
  :root { --pad: 40px; }
  .note-layout { grid-template-columns: minmax(0, 720px) 280px; column-gap: 48px; }
  .share { position: static; grid-column: 1; grid-row: 2; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
  .share .rail-label { width: 100%; }
  .share__btn { gap: 18px; }
  .prose { grid-column: 1; grid-row: 1; }
  .rail { grid-column: 2; grid-row: 1 / span 2; }
  .subscribe { gap: 40px; padding: 40px; }
  .subscribe__actions { flex-basis: 480px; }
}
@media (max-width: 1099px) {
  .subscribe { flex-direction: column; align-items: stretch; }
  .subscribe__actions { flex-basis: auto; }
}

/* tablet: one column; contents fold up above the article, follow-along moves below it */
@media (max-width: 959px) {
  .nav__bar { gap: 8px; }
  .nav__links, .nav__cta { display: none; }
  .search-btn { margin-left: auto; }
  .menu-btn { display: inline-flex; }

  .note-layout { grid-template-columns: minmax(0, 720px); padding-top: 40px; padding-bottom: 72px; }
  .rail { display: contents; }
  .toc { grid-row: 1; margin-bottom: 32px; }
  .toc__head { cursor: pointer; padding-bottom: 0; }
  .toc__head::after { content: "+"; margin-left: 12px; font: 400 16px/1 var(--f-mono); color: var(--ink-3); }
  .toc__head[aria-expanded="true"]::after { content: "–"; }
  .toc__head .toc__count { margin-left: auto; }
  .toc__list { margin-top: 10px; }
  .toc .progress { padding-bottom: 0; }
  .toc__head[aria-expanded="false"] + .toc__list { display: none; }
  .prose { grid-row: 2; }
  .share { grid-row: 3; }
  .follow { grid-row: 4; margin-top: 32px; }

  .site-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; }
  .site-foot__brand { grid-column: 1 / -1; }
  .site-foot__col { width: auto; }

  .related__row { flex-wrap: wrap; row-gap: 4px; }
}
@media (min-width: 960px) {
  .nav__panel { display: none !important; }
  .toc__head { pointer-events: none; }
  /* long contents lists scroll inside the rail instead of running off screen */
  .rail {
    max-height: calc(100vh - 64px - 48px - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
  }
}

/* phone */
@media (max-width: 719px) {
  :root { --pad: 16px; }
  .search-btn { width: 40px; padding: 0; }
  .search-btn kbd, .search__bar kbd { display: none; }
  .search { margin-top: 10vh; }

  .note-head { padding-top: 32px; padding-bottom: 28px; gap: 18px; }
  .note-head__lede { font-size: 17px; }
  .byline { gap: 12px; }
  .byline__rule { display: none; }
  .byline__who { width: 100%; justify-content: center; }
  .tags { gap: 8px; }
  .note-hero img { aspect-ratio: 3 / 2; border-radius: var(--r-md); }

  .prose { gap: 20px; }
  .prose > p { font-size: 17px; }
  .prose > ol > li, .prose > ul > li { font-size: 17px; }
  .prose > ol > li { padding-left: 38px; }
  .step { padding-top: 24px; }
  .step__title { font-size: 28px; }
  .checklist { padding: 18px; }
  .checklist__aside { display: none; }
  .callout { padding-right: 16px; }
  .repo { padding: 12px 14px; gap: 12px; }
  .repo__go { display: none; }
  .defs > div { flex-direction: column; gap: 4px; padding: 12px 16px; }
  .defs dt { width: auto; }

  .related { padding-top: 40px; padding-bottom: 56px; }
  .related__title { font-size: 30px; }
  .related__row { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 14px; row-gap: 6px; padding: 10px; }
  .related__row img { grid-row: 1 / span 2; width: 96px; height: 58px; }
  .related__name { font-size: 16px; line-height: 1.25; }
  .related__arr { display: none; }

  .footer { padding-top: 40px; }
  .subscribe { padding: 28px 20px; border-radius: 18px; gap: 28px; }
  .subscribe__copy h2 { font-size: 30px; }
  .term { padding-left: 14px; gap: 10px; }
  .term__prompt, .term__cmd { font-size: 12.5px; }
  .site-foot { padding-top: 48px; padding-bottom: 40px; }
}
@media (max-width: 380px) {
  .logo { gap: 9px; }
  .logo__sub { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .code__copy:active, .term__copy:active, .follow__btn:active { transform: none; }
  .related__row:hover .related__arr { transform: none; }
}
