/* threefold.eco content pages. Loaded after /styles.css (web/styles.css), the landing's design
   system: tokens, type, cards, tiles, pills, buttons, header and footer all come from there.
   This file only adds what content pages need: page heads, prose, code, tables, docs, blog. */

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--fg); color: #fff; padding: 10px 16px; border-radius: 999px; }
.skip:focus { left: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.site :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.site main:focus { outline: none; }
.site a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* links in running text: Threefold Sky, deepened to 5.5:1 on the background */
.site main :is(p, td, figcaption) a:not(.btn, .ghost), .site .prose li a { color: #006a97; }
.site { overflow-wrap: break-word; }

/* page head: the landing's centred eyebrow, hero and lede, a size down */
.page-head { padding: 24px 0 8px; }
.page-head h1.hero { font-size: clamp(38px, 5.6vw, 64px); max-width: 860px; }
.page-head .lede { max-width: 700px; }
.page-head .actions { justify-content: center; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.site h2 { margin-top: 64px; }
.site h2.center + .sub { text-align: center; max-width: 680px; margin-left: auto; margin-right: auto; }
.site .card h3 { font-size: 19px; }
.site .card p { color: var(--muted); margin: 6px 0 0; line-height: 1.55; font-size: 15px; }
.site .card p strong, .site .card p b { color: var(--fg); font-weight: 500; }
.tile .tile-n { font-size: 22px; }
.source { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 14px 0 0; }
.source.center { text-align: center; max-width: 760px; margin-left: auto; margin-right: auto; }

/* grid and flex children may shrink below their content: code blocks scroll instead */
.site .grid > *, .site .bento > *, .site .stats > *, .exchange > *, .docs > *, .plans > *, .actions > *, .footer > *, .nav > * { min-width: 0; }

/* code: the landing's .code look (soft, rounded, mono) */
.site pre { position: relative; background: var(--soft); border-radius: 16px; padding: 14px 16px; margin: 0 0 20px; overflow: auto; max-width: 100%; font-family: var(--mono); font-size: 13px; line-height: 1.55; }
.site pre code { white-space: pre; font-family: inherit; }
.site :not(pre) > code { font-family: var(--mono); font-size: 0.86em; background: var(--soft); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
.card pre { margin: 14px 0 0; }
.tile.dark pre { background: #252829; color: #e8e4e0; }
.copy { position: absolute; top: 8px; right: 8px; font: 500 12px var(--font); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; opacity: 0; transition: opacity 0.15s; }
pre:hover .copy, .copy:focus-visible { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.site table { border-collapse: collapse; width: 100%; font-size: 15px; }
.site th, .site td { text-align: left; vertical-align: top; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.site th { font-weight: 600; font-size: 13px; color: var(--muted); }
.site tr:last-child td { border-bottom: 0; }
.align-right { text-align: right; } .align-center { text-align: center; }

/* prose (docs, blog, long sections) */
.prose { max-width: 72ch; font-size: 17px; line-height: 1.65; }
.prose h1 { font-size: clamp(34px, 4.4vw, 48px); letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 18px; }
.prose h2 { font-size: 28px; margin: 52px 0 12px; }
.prose h3 { font-size: 20px; margin: 34px 0 8px; }
.prose h4 { font-size: 17px; margin: 26px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0 0; }
.prose blockquote { margin: 0 0 20px; padding: 14px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.prose img { height: auto; border-radius: 14px; }
.prose hr { margin: 40px 0; }
.anchor { float: left; margin-left: -1em; width: 1em; color: var(--faint); text-decoration: none; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }
.note { background: var(--accent-soft); border-radius: 16px; padding: 14px 18px; margin: 0 0 22px; }
.note p:last-child { margin-bottom: 0; }
.section-prose { max-width: 820px; margin: 0 auto; }
.section-prose > h2 { text-align: center; }

/* numbers row: the landing's .stats, four across */
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 980px; }
.stat .n { font-family: var(--font); }

/* example exchange (how it works) */
.exchange { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.exchange .bubble { margin: 0 0 14px auto; }
.exchange .call { margin-top: 0; }
.example pre { max-height: 520px; }

/* diagram */
.diagram { margin: 0; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram figcaption { color: var(--muted); font-size: 14px; margin-top: 12px; text-align: center; }

/* plans */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.plan h3 { font-size: 22px; letter-spacing: -0.02em; }
.plan .price { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 2px 0 14px; }
.plan ul { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.plan li { padding: 9px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.plan li span:last-child { text-align: right; font-weight: 500; }

/* docs */
.page-docs main { max-width: 1280px; }
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr) 200px; gap: 40px; align-items: start; padding-top: 8px; }
.docs-nav { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; padding: 16px; font-size: 14px; }
.toc { position: sticky; top: 84px; font-size: 14px; }
.docs-nav .label, .toc .label { display: block; margin: 18px 6px 6px; }
.docs-nav .label:first-child, .toc .label:first-child { margin-top: 0; }
.docs-nav ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.site .docs-nav a, .site .toc a { display: block; padding: 6px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; }
.site .docs-nav a:hover, .site .toc a:hover { color: var(--fg); background: var(--soft); }
.site .docs-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.docs-body { max-width: 780px; }
.route { font-family: var(--mono); font-size: 13px; }
.method { display: inline-block; min-width: 50px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 11px; background: var(--soft); }
.method-get { background: var(--accent-soft); color: #00577c; }
.method-post { background: #f0fdf4; color: #15803d; }
.opid { color: var(--muted); }

/* blog */
.post-list { list-style: none; padding: 0; margin: 32px auto 0; max-width: 820px; display: grid; gap: 16px; }
.post-list h2 { font-size: 24px; margin: 0 0 6px; }
.site .post-list h2 a { color: var(--fg); text-decoration: none; }
.site .post-list h2 a:hover { color: var(--accent); }
.post-list p { margin: 8px 0 0; }
.post-meta { font-family: var(--mono); color: var(--muted); font-size: 13px; margin: -4px 0 32px; }
.post-list .post-meta { margin: 0 0 8px; }
.post { margin: 8px auto 0; }
.post .eyebrow { text-align: left; margin-top: 16px; }
.post .eyebrow::before, .post .eyebrow::after { content: none; }

/* closing call to action: the landing's .finale band, without the icon pile */
.site .finale { padding: 72px 32px 96px; margin: 96px 0 -40px; border-radius: 28px; }
.site .finale .sub { margin: 12px auto 0; max-width: 620px; }
.site .finale .actions { justify-content: center; margin-top: 28px; }

/* 404 */
.not-found { padding: 40px 0 20px; }

@media (max-width: 1100px) {
  .docs { grid-template-columns: 210px minmax(0, 1fr); }
  .toc { display: none; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .site .g2, .site .g3, .site .g4, .exchange, .site .bento { grid-template-columns: minmax(0, 1fr); }
  .site .span2 { grid-column: auto; }
  .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.four .stat + .stat { border-left: 0; }
  .stats.four .stat { border-top: 1px solid var(--line); }
  .stats.four .stat:nth-child(-n + 2) { border-top: 0; }
  .stats.four .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .docs-nav { position: static; max-height: none; }
  .site .finale { padding: 56px 20px 72px; }
}
/* the decorative mark would sit behind headlines on narrow screens */
@media (max-width: 700px) {
  .site .finale::before { display: none; }
}
@media (max-width: 640px) {
  .plans { grid-template-columns: minmax(0, 1fr); }
  .site .stat .n { font-size: 30px; }
  .prose { font-size: 16px; }
}
@media print { .nav, .footer, .docs-nav, .toc, .copy, .skip { display: none !important; } }
.tile.dark :not(pre) > code { background: #3a3f40; color: #fff; }
.tile.dark h3 { color: #fff; }
