/* Learn section (/learn/). Loaded after styles.css. Daylight: the hero, FAQ
   cards, comparison table and buttons come from styles.css (.d-pagehead,
   .d-eyebrow-beam, .pr-faq, .pr-compare, .button). This file holds only the
   article measure, the contents card, the diagram and the hub cards. Tokens
   only, so Daylight and Night both follow. No inline styles (CSP). */

/* ---------- breadcrumb: small and quiet ---------- */
.lg-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}
.lg-crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--border-strong); }
.lg-crumbs a { color: var(--muted); text-decoration: none; }
.lg-crumbs a:hover { color: var(--link); }

.lg-byline { margin: 0; font-size: 14px; color: var(--muted); }

.lg-body { padding: 48px 0 96px; }

/* ---------- article layout ---------- */
.lg-layout {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  justify-content: center;
}

/* Contents card */
.lg-toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 18px 12px 12px;
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
  font-size: 14px;
}
.lg-toc-h {
  margin: 0 0 8px;
  padding: 0 10px;
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.lg-toc ol { margin: 0; padding: 0; list-style: none; }
.lg-toc li a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--secondary);
  line-height: 1.35;
  text-decoration: none;
}
.lg-toc li a:hover { background: var(--hover); color: var(--text-bright); }

/* ---------- article type ---------- */
.lg-article {
  max-width: 70ch;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  min-width: 0;
}
.lg-article p, .lg-article ul, .lg-article ol { margin: 0 0 1.1em; }
.lg-article h2 {
  margin: 2.4em 0 0.55em;
  color: var(--text-bright);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  scroll-margin-top: 24px;
}
.lg-article h3 {
  margin: 1.7em 0 0.3em;
  color: var(--text-bright);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.lg-article a { color: var(--link); }
.lg-article code {
  padding: 2px 7px;
  border-radius: var(--r-sm);
  background: var(--fill);
  font-family: var(--f-mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}
.lg-article b { color: var(--text-bright); font-weight: 600; }

/* Two-sentence answer */
.lg-answer {
  margin-bottom: 1.4em;
  padding: 24px 28px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 19px;
  line-height: 1.55;
  scroll-margin-top: 24px;
}

/* Lists: accent dots, and check marks for the buying list */
.lg-list, .lg-check { padding: 0; list-style: none; }
.lg-list li, .lg-check li { position: relative; margin-bottom: 0.8em; padding-left: 28px; }
.lg-list li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.7em;
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--accent);
}
.lg-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
}
.lg-check li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.62em;
  width: 8px;
  height: 4.5px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- diagram: rounded soft nodes, accent on the gateway only ---------- */
.lg-figure { margin: 1.8em 0; }
.lg-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; text-align: center; }
.lg-diagram { display: block; width: 100%; max-width: 480px; height: auto; margin-inline: auto; }
.lg-diagram text { font-family: var(--f-ui); }
.lg-box {
  rx: 12px;
  fill: var(--paper);
  stroke: var(--border);
  stroke-width: 1;
  filter: drop-shadow(0 1px 2px rgb(12 14 19 / 0.06)) drop-shadow(0 6px 14px rgb(12 14 19 / 0.05));
}
.lg-box-hl { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
.lg-chip { rx: 10px; fill: var(--paper); stroke: var(--border); stroke-width: 1; }
.lg-t { font-size: 17px; font-weight: 650; fill: var(--text-bright); }
.lg-s { font-size: 13.5px; fill: var(--secondary); }
.lg-n { font-size: 15px; font-weight: 600; fill: var(--muted); }
.lg-ct { font-size: 16px; font-weight: 600; fill: var(--text-bright); }
.lg-a { font-size: 13px; fill: var(--muted); }
.lg-line { stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; fill: none; }
.lg-head { fill: var(--muted); }

/* ---------- tables: .pr-compare look, scoped to four narrow columns ---------- */
.lg-table-wrap { margin: 1.6em 0; }
.lg-table { min-width: 620px; }
.lg-table th, .lg-table td { padding: 14px 18px; font-size: 15px; }
.lg-table thead th { padding-top: 16px; padding-bottom: 14px; font-size: 15px; letter-spacing: 0; }
.lg-table tbody th { width: auto; color: var(--text-bright); white-space: nowrap; }

/* FAQ uses .pr-faq */
.lg-article .pr-faq { margin: 1em 0 0; }

/* ---------- close: pill buttons ---------- */
.lg-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }
.lg-article .button { color: #ffffff; text-decoration: none; }
.lg-article .button-quiet { color: var(--text-bright); }

/* ---------- hub ---------- */
.lg-hub-h {
  margin: 0 0 20px;
  color: var(--text-bright);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.lg-hub-h + .lg-cards { margin-bottom: 64px; }
.lg-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lg-cards-feature { grid-template-columns: minmax(0, 1fr); }

.lg-card { position: relative; display: grid; gap: 8px; align-content: start; padding: 28px; border-radius: var(--r-lg); }
.lg-card h3 { margin: 6px 0 0; color: var(--text-bright); font-size: 22px; font-weight: 650; letter-spacing: -0.025em; }
.lg-card h3 a { color: inherit; text-decoration: none; }
.lg-card p { margin: 0; color: var(--secondary); font-size: 16px; line-height: 1.55; }

/* Feature card: the whole card is the link (heading link stretched) */
.lg-card-live { padding: clamp(28px, 4vw, 48px); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); }
.lg-card-live h3 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.04em; line-height: 1.05; }
.lg-card-live p { max-width: 56ch; font-size: 17px; }
.lg-card-live h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.lg-card-live h3 a:focus-visible { outline: none; }
.lg-card-live h3 a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.lg-more {
  position: relative;
  justify-self: start;
  margin-top: 8px;
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}
.lg-more::after { content: "\2192"; margin-left: 8px; transition: margin-left 200ms ease-out; }
.lg-card-live:hover .lg-more::after { margin-left: 12px; }

/* Feature card, desktop: text left, the five layers as a mini diagram right */
.lg-mini { display: none; }
@media (min-width: 901px) {
  .lg-card-live { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); column-gap: clamp(32px, 5vw, 72px); grid-template-rows: auto auto auto 1fr; }
  .lg-card-live > :not(.lg-mini) { grid-column: 1; align-self: start; }
  .lg-mini { display: grid; grid-column: 2; grid-row: 1 / span 4; align-self: center; gap: 12px; }
}
.lg-mini-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.lg-mini-row b { min-width: 1ch; color: var(--muted); font-weight: 600; }
.lg-mini-row + .lg-mini-row::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 1px;
  height: 12px;
  background: var(--border-strong);
}
.lg-mini-hl { border-color: var(--accent); background: var(--accent-soft); }
.lg-mini-hl b { color: var(--accent); }

/* Coming soon: visible, muted, not a link */
.lg-card-soon { background: transparent; border: 1px solid var(--border); box-shadow: none; }
.lg-card-soon h3 { color: var(--secondary); }
.lg-card-soon p { color: var(--muted); }

.lg-pill {
  justify-self: start;
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: var(--fill);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.lg-pill-live { background: var(--accent-soft); color: var(--accent-hover); }

@media (max-width: 900px) {
  .lg-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .lg-toc { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .lg-cards { grid-template-columns: minmax(0, 1fr); }
  .lg-hub-h + .lg-cards { margin-bottom: 48px; }
}
@media (max-width: 520px) {
  .lg-body { padding-top: 32px; }
  .lg-article { font-size: 16px; }
  .lg-answer { padding: 20px; font-size: 17px; }
  .lg-actions .button { flex: 1 1 auto; }
}

/* ======================================================================
   Insights (/insights/). Everything below is shared by the generated front
   page, section pages and posts (tools/build-insights.py). Tokens only.
   ====================================================================== */

/* strong/em from Markdown match the hand-written <b> */
.lg-article strong { color: var(--text-bright); font-weight: 600; }

/* Section filter: soft pills */
.ins-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 40px; }
.ins-filter a {
  padding: 8px 16px;
  border-radius: var(--r-full);
  background: var(--fill);
  color: var(--secondary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: background 200ms ease-out, color 200ms ease-out;
}
.ins-filter a:hover { background: var(--hover); color: var(--text-bright); }
.ins-filter a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-hover); }

/* Card meta row: section pill, date, reading time */
.ins-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; color: var(--muted); font-size: 14px; }
.lg-card .ins-meta { font-size: 14px; line-height: 1.4; color: var(--muted); }
.ins-meta .lg-pill { background: var(--accent-soft); color: var(--accent-hover); }

/* Post cards in the grid: whole card is the link, same stretch as the feature card */
.lg-card-post { padding: 28px; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); }
.lg-card-post h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.lg-card-post h3 a:focus-visible { outline: none; }
.lg-card-post h3 a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Empty section */
.ins-empty {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.ins-empty .lg-hub-h { margin: 0; }
.ins-empty p { margin: 0 0 8px; color: var(--secondary); font-size: 17px; }

/* Under the article: related posts, previous / next */
.ins-more { padding-top: 0; }
.ins-more .lg-hub-h + .lg-cards { margin-bottom: 40px; }
.ins-pn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ins-pn a {
  display: grid;
  gap: 4px;
  padding: 20px 24px;
  border-radius: var(--r-md);
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--text-bright);
  text-decoration: none;
  transition: box-shadow 200ms ease-out;
}
.ins-pn a:hover { box-shadow: var(--shadow-lg); }
.ins-pn span { color: var(--muted); font-size: 13px; font-weight: 600; }
.ins-pn b { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.ins-pn-next { grid-column: 2; text-align: right; }
.ins-pn-prev:only-child { grid-column: 1; }

/* Posts without H2s have no contents card: one centred column */
.lg-layout.ins-solo { grid-template-columns: minmax(0, 70ch); }

/* Markdown extras: code blocks, quotes, images, table alignment */
.lg-article pre {
  margin: 1.4em 0;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--fill);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
}
.lg-article pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; }
.lg-article blockquote {
  margin: 1.4em 0;
  padding: 18px 24px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
}
.lg-article blockquote p:last-child { margin-bottom: 0; }
.lg-article img { display: block; max-width: 100%; height: auto; border-radius: var(--r-md); }
.lg-article hr { margin: 2em 0; border: 0; border-top: 1px solid var(--border); }
.lg-table .ins-right { text-align: right; }
.lg-table .ins-center { text-align: center; }

@media (max-width: 900px) {
  .lg-layout.ins-solo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ins-pn { grid-template-columns: minmax(0, 1fr); }
  .ins-pn-next { grid-column: 1; text-align: left; }
  .ins-filter { margin-bottom: 28px; }
}
