/* Subpages built by scripts/build-site.js (use cases, comparisons, guides, indexes).
   Sits on top of style.css: same tokens, fonts, buttons, nav, waitlist form, FAQ and footer, so light and dark both work. */

/* ---------- Page frame ---------- */
.sub main { padding-top: 112px; }
.article {
  --measure: 70ch;
  width: 100%; max-width: calc(var(--measure) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter);
  font-size: 18px;
}

/* ---------- Breadcrumbs ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin: 0 0 22px; padding: 0; list-style: none; font: 500 13px/1.4 var(--sans); color: var(--ink-3); }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "›"; margin: 0 9px; color: var(--ink-3); opacity: .7; }
.crumbs a { color: var(--ink-2); text-decoration: none; padding: 6px 0; }
.crumbs a:hover { color: var(--amber-ink); }
.crumbs [aria-current] { display: block; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; }

/* ---------- Title block ---------- */
.article-head { padding-bottom: 36px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
.article-head h1 { font-size: clamp(36px, 5.4vw, 58px); line-height: 1.03; letter-spacing: -.045em; }
.article-head .lede { max-width: 62ch; margin-top: 20px; font-size: clamp(18px, 1.6vw, 21px); }
.article-head .lede strong { color: var(--ink); font-weight: 600; }
.byline span { white-space: nowrap; }
.byline { margin-top: 22px; font: 500 13px/1.5 var(--mono); color: var(--ink-3); letter-spacing: .01em; }

/* ---------- Article text ---------- */
.prose { color: var(--ink-2); color: color-mix(in srgb, var(--ink) 80%, var(--ink-2)); line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.4em; margin-bottom: -.2em; color: var(--ink); font-size: clamp(26px, 3vw, 34px); line-height: 1.12; letter-spacing: -.035em; scroll-margin-top: 96px; }
.prose h3 { margin-top: 1.9em; margin-bottom: -.4em; color: var(--ink); font-size: clamp(20px, 2vw, 22px); line-height: 1.25; letter-spacing: -.02em; scroll-margin-top: 96px; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--amber-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: color .2s; }
.prose a:hover { color: var(--amber-ink); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: .45em; }
.prose li > ul, .prose li > ol { margin-top: .45em; }
.prose ul li::marker { color: var(--amber-ink); }
.prose ol li::marker { color: var(--ink-3); font: 500 .85em var(--mono); }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--amber); color: var(--ink); font-size: 1.06em; }
.prose blockquote p + p { margin-top: .7em; }
.prose code { padding: .12em .38em; border-radius: 6px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); font: 400 .86em/1 var(--mono); color: var(--ink); }
.prose figure { margin: 1.8em 0 0; }
.prose figure img { width: 100%; height: auto; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line), 0 20px 50px -24px var(--shadow-soft); }
.prose figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-3); }
.prose img { height: auto; }

/* ---------- Callouts ---------- */
.callout {
  position: relative; padding: 20px 22px 20px 24px; border-radius: var(--r); overflow: hidden;
  background: linear-gradient(120deg, var(--amber-soft), transparent 70%), var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink);
}
.callout::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--amber), var(--ember)); }
.callout.tip { background: linear-gradient(120deg, var(--teal-soft), transparent 70%), var(--panel); }
.callout.tip::before { background: var(--teal); }
.callout > * + * { margin-top: .7em; }
.callout ul, .callout ol { padding-left: 1.2em; }
.prose .callout { margin-top: 1.6em; }
.prose .callout + * { margin-top: 1.6em; }

/* ---------- Tables ---------- */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r);
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
}
.prose .table-scroll { margin-top: 1.6em; }
.prose .table-scroll + * { margin-top: 1.6em; }
.table-scroll:focus-visible { outline-offset: 2px; }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.table-scroll table:has(tr > :nth-child(4)), .table-scroll .cmp-table { min-width: 560px; }
.table-scroll caption { padding: 14px 16px 0; text-align: left; font-size: 14px; color: var(--ink-3); }
.table-scroll th, .table-scroll td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-scroll tbody tr:last-child > * { border-bottom: 0; }
.table-scroll thead th { font: 500 11.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.table-scroll tbody th { color: var(--ink); font-weight: 600; }

/* Comparison table: label column, then Hintly (emphasised), then the others. */
.cmp-table tbody th, .cmp-table tbody td:first-child { color: var(--ink); font-weight: 500; }
.cmp-table thead th:nth-child(2) { color: var(--amber-ink); }
.cmp-table th:nth-child(2), .cmp-table td:nth-child(2) { background: var(--amber-soft); color: var(--ink); font-weight: 600; }
.cmp-table thead th:nth-child(2) { border-radius: 10px 10px 0 0; }
.cmp-table thead th:first-child, .cmp-table tbody > tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); min-width: 140px; }

/* ---------- FAQ (reuses the homepage's .qs accordion) ---------- */
.article-faq { margin-top: 72px; }
.article-faq h2, .related h2 { margin-bottom: 18px; font-size: clamp(26px, 3vw, 34px); line-height: 1.12; letter-spacing: -.035em; }
.article-faq .qs summary { font-size: 18px; }
.article-faq .qs details p { padding-right: 32px; font-size: 17px; line-height: 1.65; }

/* ---------- Related ---------- */
.related { margin-top: 64px; }
.related ul { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
.related a {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px 18px; border-radius: var(--r); text-decoration: none;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, transform .18s var(--ease);
}
.related a:hover { box-shadow: inset 0 0 0 1px var(--amber-ink); transform: translateY(-1px); }
.related-kicker, .card-kicker { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber-ink); }
.related-title { font-size: 16.5px; font-weight: 500; line-height: 1.35; letter-spacing: -.01em; color: var(--ink); }

/* ---------- Waitlist blocks ---------- */
.cta-inline {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center;
  margin: 2.2em 0 0; padding: 32px 20px 26px; border-radius: 22px; background: var(--frame); box-shadow: inset 0 0 0 1px var(--line-2);
}
.cta-inline::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .8;
  background:
    radial-gradient(55% 80% at 0% 0%, rgba(255, 120, 40, .32), transparent 70%),
    radial-gradient(50% 80% at 100% 100%, rgba(25, 180, 160, .26), transparent 70%);
}
.prose .cta-inline + * { margin-top: 2.2em; }
.cta-title { color: var(--ink); font-size: clamp(22px, 2.4vw, 27px); font-weight: 600; line-height: 1.15; letter-spacing: -.03em; text-wrap: balance; }
.cta-text { margin-top: 10px; max-width: 42ch; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.cta-inline .waitlist { margin-top: 20px; }
.cta-inline .waitlist-msg { min-height: 0; margin-top: 10px; }
.cta-inline .waitlist-msg:empty { display: none; }
.cta-note { margin-top: 12px; font-size: 13.5px; color: var(--ink-3); }

.page-final { margin-top: clamp(72px, 9vw, 120px); }
.page-final .final-inner { gap: 18px; padding: clamp(64px, 9vw, 112px) var(--gutter); }
.page-final h2 { font-size: clamp(34px, 5vw, 60px); }
.page-final .lede { max-width: 38ch; }

/* ---------- Index pages (/blog/, /compare/) ---------- */
.index-list > * + * { margin-top: 48px; }
.card-group h2 { margin-bottom: 18px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; letter-spacing: -.03em; }
.cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0; padding: 0; list-style: none; }
.card a {
  display: flex; flex-direction: column; gap: 9px; height: 100%; padding: 20px 22px; border-radius: 18px; text-decoration: none;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, transform .18s var(--ease);
}
.card a:hover { box-shadow: inset 0 0 0 1px var(--amber-ink), 0 18px 40px -24px var(--shadow-soft); transform: translateY(-2px); }
.card-title { font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.card-lede { font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.card-date { margin-top: auto; padding-top: 4px; font: 500 12.5px/1 var(--mono); color: var(--ink-3); }
.empty { color: var(--ink-2); }

/* ---------- Wider screens ---------- */
@media (min-width: 700px) {
  .related ul { grid-template-columns: 1fr 1fr; }
  .cta-inline { padding: 36px 32px 28px; }
}
@media (min-width: 1000px) {
  /* Indexes use the full content width for a two-column card grid. */
  .sub .article:has(.index-list) { --measure: 960px; }
  .cards { grid-template-columns: 1fr 1fr; }
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .sub main { padding-top: 92px; }
  .article { font-size: 17px; }
  .article-head { padding-bottom: 28px; margin-bottom: 32px; }
  .crumbs [aria-current] { max-width: 22ch; }
  .page-final h2 { font-size: clamp(30px, 8.6vw, 40px); }
  .table-scroll { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); border-radius: 0; box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); }
  .table-scroll table { font-size: 14px; }
  .table-scroll th, .table-scroll td { padding: 12px 12px; }
  .cmp-table thead th:first-child, .cmp-table tbody > tr > :first-child { min-width: 118px; }
  .cta-inline { margin-left: calc(var(--gutter) * -.5); margin-right: calc(var(--gutter) * -.5); }
  .article-faq .qs details p { padding-right: 0; }
}

@media print {
  .nav, .theme-btn, .cta-inline, .page-final, .related { display: none !important; }
  .sub main { padding-top: 0; }
}

/* On this page (long posts) */
.toc { margin: 0 0 40px; padding: 18px 22px 20px; border-radius: var(--r); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.toc-title { margin: 0 0 10px; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber-ink); }
.toc ol { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 32px; counter-reset: toc; }
.toc li { break-inside: avoid; counter-increment: toc; padding: 4px 0; font-size: 15.5px; line-height: 1.4; }
.toc li::before { content: counter(toc, decimal-leading-zero); margin-right: 10px; font: 500 12px var(--mono); color: var(--ink-3); }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--amber-ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .toc ol { columns: 1; } }
@media print { .toc { display: none; } }

/* Code blocks in guides (Python, Java, SQL, LeetCode posts) */
.prose pre { margin: 1.4em 0 0; padding: 16px 18px; border-radius: var(--r); background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; tab-size: 4; }
.prose pre code { padding: 0; border-radius: 0; background: none; box-shadow: none; font: 400 14px/1.6 var(--mono); white-space: pre; color: var(--ink); }
.prose pre + * { margin-top: 1.4em; }
@media (max-width: 640px) { .prose pre { padding: 14px; } .prose pre code { font-size: 13px; } }

/* Long inline code (method chains, queries) wraps instead of widening the page */
.prose :not(pre) > code { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
