/* Kern site. System fonts only, no external requests. */
:root {
  --bg: #f2f4f6;
  --bg-code: #e6eaee;
  --ink: #0f1a24;
  --muted: #485766;
  --rule: #c7d0d8;
  --accent: #0b4fd6;
  --accent-ink: #ffffff;
  --signal: #a8330c;
  --hl-k: #0b4fd6;
  --hl-t: #7a3e9d;
  --hl-s: #1d7a46;
  --hl-n: #a8330c;
  --hl-c: #6a7886;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 72rem;
  --gutter: 1rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1218;
    --bg-code: #151e27;
    --ink: #e2e8ee;
    --muted: #97a5b3;
    --rule: #283542;
    --accent: #7fa8ff;
    --accent-ink: #0c1218;
    --signal: #ff8f61;
    --hl-k: #7fa8ff;
    --hl-t: #c49cf0;
    --hl-s: #7fd49d;
    --hl-n: #ff9d73;
    --hl-c: #7d8c9b;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1218; --bg-code: #151e27; --ink: #e2e8ee; --muted: #97a5b3; --rule: #283542;
  --accent: #7fa8ff; --accent-ink: #0c1218; --signal: #ff8f61;
  --hl-k: #7fa8ff; --hl-t: #c49cf0; --hl-s: #7fd49d; --hl-n: #ff9d73; --hl-c: #7d8c9b;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
code, pre { font-family: var(--mono); }
code { font-size: 0.86em; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* top bar */
.top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  max-width: var(--wrap); margin: 0 auto; padding: 0.9rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.brand { font-weight: 700; font-size: 1.5rem; letter-spacing: -0.04em; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: 1rem; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); text-decoration: underline; }
.foot { max-width: var(--wrap); margin: 4rem auto 0; padding: 1.5rem var(--gutter) 3rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.95rem; }
.foot p { margin: 0; max-width: 46rem; }

/* code */
pre {
  margin: 1.25rem 0; padding: 0.9rem 1rem; overflow-x: auto;
  background: var(--bg-code); border-left: 3px solid var(--accent);
  font-size: 0.875rem; line-height: 1.5; tab-size: 4;
}
pre code { font-size: inherit; }
:not(pre) > code { background: var(--bg-code); padding: 0.08em 0.3em; border-radius: 3px; overflow-wrap: anywhere; }
.k { color: var(--hl-k); font-weight: 600; }
.t { color: var(--hl-t); }
.s { color: var(--hl-s); }
.n { color: var(--hl-n); }
.c { color: var(--hl-c); font-style: italic; }
pre.trap { border-left-color: var(--signal); color: var(--signal); margin-top: 0.5rem; }

/* landing */
.home main { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.hero { display: grid; gap: 2rem; padding: 2.5rem 0 1rem; }
.hero h1 {
  margin: 0; font-size: clamp(5rem, 22vw, 11rem); line-height: 0.82; font-weight: 700;
  letter-spacing: -0.075em; margin-left: -0.04em;
}
.goal { font-size: clamp(1.4rem, 3.6vw, 2rem); line-height: 1.25; letter-spacing: -0.01em; margin: 1.5rem 0 1rem; max-width: 34rem; }
.lede { color: var(--muted); max-width: 34rem; margin: 0 0 1.5rem; }
.cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 0 0 1.25rem; }
.btn {
  display: inline-block; padding: 0.55rem 1.1rem; border: 1.5px solid var(--ink); color: var(--ink);
  text-decoration: none; font-size: 1rem; border-radius: 2px;
}
.btn:hover { background: var(--bg-code); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); }
.status { margin: 0; font-size: 1rem; color: var(--muted); }
.status strong { color: var(--signal); }
.hero-code { margin: 0; min-width: 0; }
.hero-code pre { margin: 0; }
.hero-code pre.trap { margin-top: 0.5rem; }
figcaption { font-size: 0.875rem; color: var(--muted); margin: 0.4rem 0 0.9rem; }
@media (min-width: 62rem) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: end; gap: 3rem; padding-top: 3.5rem; }
}

.band { display: grid; gap: 0.75rem 3rem; padding: 2.75rem 0 0; margin-top: 2.75rem; border-top: 1px solid var(--rule); }
.band h2 { margin: 0; font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.02em; }
.band h3 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.band p { margin: 0 0 1rem; max-width: 40rem; }
.band .table-wrap, .band pre { max-width: 52rem; }
.note { color: var(--muted); font-size: 0.98rem; }
@media (min-width: 62rem) {
  .band { grid-template-columns: 13rem minmax(0, 1fr); }
  .band > h2 { grid-column: 1; }
  .band > *:not(h2) { grid-column: 2; }
}
.two { display: grid; gap: 1.5rem 3rem; }
.two > div > p:last-child { margin-bottom: 0; }
@media (min-width: 46rem) { .two { grid-template-columns: 1fr 1fr; } }

.facts { margin: 0; display: grid; gap: 0; max-width: 52rem; }
.facts dt { font-weight: 700; margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); }
.facts dt:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.facts dd { margin: 0.15rem 0 0; color: var(--muted); }
.facts dd code { color: var(--ink); }
@media (min-width: 46rem) {
  .facts { grid-template-columns: 13rem 1fr; column-gap: 2rem; }
  .facts dt, .facts dd { margin: 0; padding: 1rem 0; border-top: 1px solid var(--rule); }
  .facts dt:first-child, .facts dt:first-child + dd { border-top: 0; padding-top: 0; }
}

.mods { display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem; max-width: 52rem !important; }
.mods a { text-decoration: none; padding: 0.12rem 0.55rem; border: 1px solid var(--rule); border-radius: 2px; color: var(--ink); }
.mods a:hover { border-color: var(--accent); color: var(--accent); }
.mods code { background: none; padding: 0; }
.method { max-width: 46rem; }

/* benchmark bars */
.bars { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.5rem; }
.bars li { display: grid; grid-template-columns: 4.6rem 1fr 7.5rem; align-items: center; gap: 0.6rem; font-size: 0.95rem; }
.bars .who { white-space: nowrap; }
.bars .val { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); text-align: right; }
.bars .track { display: block; height: 0.85rem; }
.bars .fill { display: block; height: 100%; background: var(--muted); opacity: 0.55; min-width: 2px; }
.bars .fill.cut { background: repeating-linear-gradient(135deg, var(--muted) 0 6px, transparent 6px 9px); }
.bars li.kern { font-weight: 700; }
.bars li.kern .fill { background: var(--accent); opacity: 1; }
.bars li.kern .val { color: var(--ink); }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.25rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; border-bottom: 2px solid var(--ink); white-space: nowrap; }
th.al-right, td.al-right { text-align: right; }
td code, th code { font-size: 0.85em; }

/* docs layout */
.docs .top { max-width: 84rem; }
.shell { max-width: 84rem; margin: 0 auto; padding: 0 var(--gutter); display: block; }
.side, .toc { display: none; }
.docs main { min-width: 0; padding: 1rem 0 0; }
.docs .nf { max-width: 46rem; margin: 0 auto; padding: 1rem var(--gutter); }
.m-nav, .m-toc { margin: 0 0 0.75rem; border: 1px solid var(--rule); font-size: 0.98rem; }
.m-nav summary, .m-toc summary { cursor: pointer; padding: 0.55rem 0.8rem; font-weight: 700; }
.m-nav nav, .m-toc nav { padding: 0 0.8rem 0.8rem; }
.grp { margin: 1.1rem 0 0.3rem; font-weight: 700; font-size: 0.95rem; }
.side ul, .toc ul, .m-nav ul, .m-toc ul { list-style: none; margin: 0; padding: 0; }
.side a, .toc a, .m-nav a, .m-toc a { display: block; padding: 0.2rem 0; color: var(--muted); text-decoration: none; font-size: 0.95rem; line-height: 1.35; }
.side a:hover, .toc a:hover, .m-nav a:hover, .m-toc a:hover { color: var(--ink); text-decoration: underline; }
.side a[aria-current], .m-nav a[aria-current] { color: var(--ink); font-weight: 700; border-left: 3px solid var(--accent); padding-left: 0.5rem; margin-left: -0.65rem; }
.toc li.d3 a { padding-left: 0.9rem; font-size: 0.88rem; }
.m-toc li.d3 a { padding-left: 0.9rem; }
@media (min-width: 62rem) {
  .shell { display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); gap: 3rem; }
  .side { display: block; position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 1rem 0 2rem; }
  .m-nav, .m-toc { display: none; }
  .docs main { padding-top: 1.5rem; }
}
@media (min-width: 82rem) {
  .shell { grid-template-columns: 14.5rem minmax(0, 46rem) 14rem; gap: 3rem; justify-content: center; }
  .toc { display: block; position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 1rem 0 2rem; }
  .m-toc { display: none; }
}

/* prose */
.prose { max-width: 46rem; }
.prose h1 { font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.1; letter-spacing: -0.035em; margin: 0.5rem 0 1.25rem; }
.prose h2 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.02em; margin: 2.75rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.prose h3 { font-size: 1.25rem; line-height: 1.25; margin: 2rem 0 0.5rem; }
.prose h4 { font-size: 1.05rem; margin: 1.5rem 0 0.4rem; }
.prose .anchor { color: inherit; text-decoration: none; }
.prose .anchor:hover { text-decoration: underline; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin: 0.25rem 0; }
.prose li > p { margin-bottom: 0.5rem; }
.prose blockquote { margin: 1rem 0; padding: 0.1rem 1rem; border-left: 3px solid var(--rule); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
.prose img { max-width: 100%; height: auto; }
.prose .repo-path { border-bottom: 1px dotted var(--muted); cursor: help; }
.prose > h2 + p, .prose > h3 + p { margin-top: 0; }
.idx { margin: 0 0 1.5rem; }
.idx dt { font-weight: 700; margin-top: 0.8rem; }
.idx dd { margin: 0; color: var(--muted); }
.src { color: var(--muted); font-size: 0.9rem; margin: 2.5rem 0 1rem; }
.pn { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.pn a { text-decoration: none; display: block; max-width: 48%; }
.pn a[rel="next"] { text-align: right; margin-left: auto; }
.pn span { display: block; font-size: 0.85rem; color: var(--muted); }

@media (max-width: 40rem) {
  body { font-size: 1.0625rem; }
  .bars li { grid-template-columns: 4.2rem 1fr; }
  .bars .val { grid-column: 2; text-align: left; margin-top: -0.35rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero h1 { animation: set 0.7s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes set { from { letter-spacing: 0.04em; opacity: 0; } to { letter-spacing: -0.075em; opacity: 1; } }
}
@media print { .top, .side, .toc, .m-nav, .m-toc, .foot, .pn { display: none; } }

/* bar widths */
.run-0{width:32.22%}
.run-1{width:35.56%}
.run-2{width:38.89%}
.run-3{width:46.67%}
.run-4{width:51.11%}
.run-5{width:77.78%}
.run-6{width:100.00%}
.run-7{width:100.00%}
.build-0{width:8.65%}
.build-1{width:22.84%}
.build-2{width:36.14%}
.build-3{width:73.95%}
.build-4{width:100.00%}
