/* Cotton code: the site's type and colours (apps/cotton-site/src/site/cotton.css), for reading code. One stylesheet, nothing from another origin. */

@font-face { font-family: "Fraunces"; src: url("/assets/Fraunces.ae1d21f0a3.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/Figtree.8330490a01.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ground: #f3f3f0;
  --paper: #fbfbf9;
  --ink: #18181a;
  --muted: #5e5e5a;
  --line: #dddcd6;
  --accent: #1c7a44;
  --mark: rgb(28 122 68 / .12);
  /* code */
  --c-comment: #7a7a72;
  --c-string: #1c7a44;
  --c-keyword: #7a2e8a;
  --c-number: #9a5a12;
  --c-type: #1f5f99;
  --gutter: clamp(1rem, 4.4vw, 2.5rem);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #151311; --paper: #1c1a17; --ink: #ece6da; --muted: #a8a092; --line: #322d27; --accent: #7ed6a1; --mark: rgb(126 214 161 / .14);
    --c-comment: #8d857a; --c-string: #7ed6a1; --c-keyword: #d6a2e6; --c-number: #e6b673; --c-type: #8cc4f2;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; text-wrap: balance; margin: 1.6rem 0 .6rem; }
h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); letter-spacing: -.015em; }
h2 { font-size: 1.35rem; }
p { margin: 0 0 .8rem; text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: .06em; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: .3rem; }
::selection { background: var(--ink); color: var(--ground); }
code, pre { font-family: var(--mono); font-size: .875rem; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--gutter), 76rem); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--ground); padding: .6rem 1rem; border-radius: 999px; z-index: 5; text-decoration: none; }
.skip:focus { top: 1rem; }
.meta { color: var(--muted); font-size: .875rem; }

.top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1.2rem; padding-block: 1.4rem .6rem; }
@media (min-width: 46rem) { .top { padding-block: 2.4rem 1rem; } }
.mark { font-family: var(--serif); font-variation-settings: "SOFT" 100; font-size: 1.45rem; font-weight: 500; letter-spacing: -.015em; text-decoration: none; }
.mark-sub { color: var(--accent); font-weight: 400; }
.nav { display: flex; gap: 1.1rem; font-size: .95rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.foot { color: var(--muted); font-size: .85rem; padding-block: 2.5rem 2rem; border-top: 1px solid var(--line); margin-top: 3rem; }

.hero { max-width: 44rem; }
.hero h1 { margin-top: 1rem; }
.facts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.6rem 0; }
.fact { background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem 1.2rem; }
.fact h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.fact p { margin: 0; }
.cmd { background: var(--paper); border: 1px solid var(--line); border-radius: .8rem; padding: .8rem 1rem; overflow-x: auto; }
.downloads { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .8rem; }
.hash { font-size: .75rem; word-break: break-all; }
.button { display: inline-block; margin: .4rem .5rem .4rem 0; padding: .55rem 1.1rem; border-radius: 999px; background: var(--ink); color: var(--ground); text-decoration: none; }
.button:hover { color: var(--ground); background: var(--accent); }

.prose { max-width: 46rem; }
.prose pre { background: var(--paper); border: 1px solid var(--line); border-radius: .8rem; padding: .8rem 1rem; overflow-x: auto; }
.prose :not(pre) > code { background: var(--paper); border: 1px solid var(--line); border-radius: .35rem; padding: 0 .3em; font-size: .85em; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; margin: 1rem 0; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .4rem .8rem .4rem 0; text-align: left; vertical-align: top; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.readme { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.crumbs { font-family: var(--mono); font-size: .9rem; margin: .6rem 0 1rem; overflow-wrap: anywhere; }
.crumbs a { text-decoration: none; color: var(--accent); }
.crumbs .sep { color: var(--muted); margin: 0 .25em; }
.listing { list-style: none; padding: 0; margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 1rem; border-top: 1px solid var(--line); font-family: var(--mono); font-size: .9rem; }
.row:first-child { border-top: 0; }
.row a { text-decoration: none; overflow-wrap: anywhere; }
.row.dir a { font-weight: 600; }
.row .meta { white-space: nowrap; font-family: var(--sans); }

.filebar { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.code { background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; padding: .8rem 0; margin: 0; overflow-x: auto; line-height: 1.5; tab-size: 4; }
.code code { display: block; min-width: max-content; counter-reset: ln; }
.code code > span { display: block; padding-right: 1rem; counter-increment: ln; }
.code code > span:target { background: var(--mark); }
.code code > span > a:first-child { display: inline-block; width: 3.6em; padding-right: 1em; margin-right: .2em; text-align: right; color: var(--muted); text-decoration: none; user-select: none; -webkit-user-select: none; position: sticky; left: 0; background: var(--paper); }
.code code > span > a:first-child::before { content: counter(ln); }
.code code > span:target > a:first-child { background: transparent; color: var(--accent); }
@media (max-width: 40rem) { .code { font-size: .8rem; border-radius: .6rem; } .code code > span > a:first-child { width: 2.8em; padding-right: .6em; } }
.c { color: var(--c-comment); font-style: italic; }
.s { color: var(--c-string); }
.k { color: var(--c-keyword); }
.n { color: var(--c-number); }
.t { color: var(--c-type); }

.search { display: flex; gap: .5rem; margin: 1rem 0 1.4rem; }
.search input { flex: 1; min-width: 0; font: inherit; padding: .65rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.search button { font: inherit; padding: .65rem 1.2rem; border-radius: 999px; border: 0; background: var(--ink); color: var(--ground); cursor: pointer; }
.hits { list-style: none; padding: 0; margin: 0 0 1.6rem; }
.hit { background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; padding: .7rem 1rem; margin-bottom: .7rem; }
.hit > a { font-family: var(--mono); font-size: .9rem; text-decoration: none; color: var(--accent); overflow-wrap: anywhere; }
.hit ol { list-style: none; padding: 0; margin: .4rem 0 0; }
.hit li a { display: block; font-family: var(--mono); font-size: .8rem; text-decoration: none; white-space: pre; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.hit li a span { color: var(--muted); display: inline-block; min-width: 3.2em; }
.hit mark { background: var(--mark); color: inherit; border-radius: .2em; }

/* pictures and PDFs */
.thumb { width: 28px; height: 28px; flex: none; object-fit: contain; border-radius: .3rem; vertical-align: middle; margin-right: .6rem; background-color: var(--paper); background-image: conic-gradient(var(--line) 25%, transparent 0 50%, var(--line) 0 75%, transparent 0); background-size: 8px 8px; }
.thumb-mark { display: inline-block; background: var(--ground); border: 1px solid var(--line); position: relative; box-sizing: border-box; }
.thumb-mark::after { content: ""; position: absolute; inset: 7px 5px 6px; background: var(--muted); clip-path: polygon(0 100%, 35% 35%, 60% 70%, 75% 50%, 100% 100%); }
.with-thumb { display: inline-flex; align-items: center; min-width: 0; }
.picture { margin: 0; padding: clamp(.8rem, 3vw, 1.6rem); border: 1px solid var(--line); border-radius: 1rem; text-align: center;
  background-color: var(--paper); background-image: conic-gradient(var(--line) 25%, transparent 0 50%, var(--line) 0 75%, transparent 0); background-size: 20px 20px; }
.picture img { max-width: 100%; height: auto; vertical-align: middle; }
.source { margin-top: 1.2rem; }
.source summary { cursor: pointer; color: var(--accent); }
.filebar .actions { display: inline-flex; gap: 1rem; flex-wrap: wrap; }
.row.pic { align-items: center; }
.pdf-frame { display: grid; border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; background: var(--paper); }
.pdf-frame > * { grid-area: 1 / 1; }
.pdf-behind { align-self: center; justify-self: center; max-width: 22rem; margin: 0; padding: 1.5rem; text-align: center; color: var(--muted); }
.pdf { position: relative; display: block; width: 100%; height: min(80vh, 60rem); border: 0; background: transparent; }
