/* Croner documentation. Colors follow the logo: green #1c9954 and navy #1d2936. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --brand: #1c9954;
  --bg: light-dark(#ffffff, #0d1117);
  --bg-soft: light-dark(#f6f8fa, #151b23);
  --bg-code: light-dark(#f6f8fa, #151b23);
  --bg-hover: light-dark(#eef1f4, #1c232c);
  --fg: light-dark(#1d2936, #e6edf3);
  --fg-strong: light-dark(#0f1720, #f6f8fa);
  --muted: light-dark(#59636e, #9198a1);
  --line: light-dark(#d9dee3, #2a313b);
  --line-soft: light-dark(#e8ebef, #212830);
  --link: light-dark(#13773f, #4cc583);
  --accent-bg: light-dark(#e8f5ee, #12261c);
  --note: light-dark(#0969da, #4493f8);
  --warning: light-dark(#9a6700, #d29922);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header: 3.75rem;
  --radius: 8px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + 1.25rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.7 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: .5rem; z-index: 100; background: var(--bg); padding: .5rem 1rem; }
.skip:focus { left: .5rem; }
kbd {
  font: 500 .7rem/1 var(--mono);
  padding: .2rem .35rem;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--muted);
  background: var(--bg);
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.top-inner { height: 100%; max-width: 90rem; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--fg-strong); font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.top-links { display: flex; gap: .25rem; margin-left: 1.75rem; }
.top-links a { color: var(--muted); font-size: .9rem; font-weight: 500; padding: .4rem .7rem; border-radius: 6px; }
.top-links a:hover, .top-links a[aria-current] { color: var(--fg-strong); text-decoration: none; }
.top-links a[aria-current] { background: var(--bg-soft); }
.search-button {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 15rem;
  padding: .4rem .5rem .4rem .75rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}
.search-button:hover { border-color: var(--muted); }
.search-button kbd { margin-left: auto; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-button:hover { color: var(--fg-strong); background: var(--bg-soft); }
.menu { display: none; margin-left: -.5rem; }

/* Layout */
.shell { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr) 15rem; max-width: 90rem; margin: 0 auto; }
.sidebar, .toc {
  position: sticky;
  top: var(--header);
  align-self: start;
  max-height: calc(100vh - var(--header));
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: .875rem;
}
.sidebar { padding: 1.75rem 1rem 2rem 1.5rem; border-right: 1px solid var(--line-soft); }
.toc { padding: 2.5rem 1.5rem 2rem 1rem; }
.sidebar ul, .toc ul, .site-footer ul { list-style: none; margin: 0; padding: 0; }
.nav-title {
  margin: 1.5rem 0 .4rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-strong);
}
.sidebar .nav-title:first-child, .toc .nav-title { margin-top: 0; }
.sidebar a { display: flex; align-items: baseline; justify-content: space-between; padding: .3rem .65rem; margin-left: -.65rem; border-radius: 6px; color: var(--muted); }
.sidebar a:hover { color: var(--fg-strong); background: var(--bg-hover); text-decoration: none; }
.sidebar a[aria-current] { color: var(--link); background: var(--accent-bg); font-weight: 600; }
.sidebar small { font-size: .75rem; color: var(--muted); opacity: .8; }
.toc a { display: block; padding: .25rem 0 .25rem .75rem; border-left: 2px solid var(--line-soft); color: var(--muted); line-height: 1.45; }
.toc a:hover { color: var(--fg-strong); text-decoration: none; }
.toc a.active { color: var(--link); border-left-color: var(--link); }
.toc .sub a { padding-left: 1.5rem; font-size: .825rem; }
main { min-width: 0; padding: 2.5rem 3.5rem 4rem; }
.content { max-width: 52rem; }

/* Content */
.eyebrow { margin: 0 0 .5rem; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--link); }
.content h1, .content h2, .content h3, .content h4 { color: var(--fg-strong); line-height: 1.3; font-weight: 650; letter-spacing: -.015em; position: relative; }
.content h1 { font-size: 2.25rem; font-weight: 700; letter-spacing: -.025em; margin: 0 0 1.25rem; }
.content h1 + hr { display: none; }
.content h2 { font-size: 1.5rem; margin: 3rem 0 1rem; padding-top: 2rem; border-top: 1px solid var(--line-soft); }
.content h3 { font-size: 1.175rem; margin: 2.25rem 0 .75rem; }
.content h4 { font-size: 1rem; margin: 1.75rem 0 .5rem; }
.content > :first-child, .content .eyebrow + h1 { margin-top: 0; }
.anchor { margin-left: .4rem; color: var(--muted); font-weight: 400; opacity: 0; transition: opacity .15s; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }
.content p, .content ul, .content ol { margin: 0 0 1.1rem; }
.content ul, .content ol { padding-left: 1.4rem; }
.content li { margin: .3rem 0; }
.content li > ul, .content li > ol { margin: .3rem 0 0; }
.content li::marker { color: var(--muted); }
.content strong { color: var(--fg-strong); font-weight: 600; }
.content hr { border: 0; border-top: 1px solid var(--line-soft); margin: 2.5rem 0; }
.content img { max-width: 100%; }
.lead { font-size: 1.2rem; line-height: 1.6; color: var(--muted); }

code { font-family: var(--mono); font-size: .85em; }
:not(pre) > code {
  padding: .15em .4em;
  border-radius: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  color: var(--fg-strong);
  overflow-wrap: break-word;
}

/* Code blocks */
.code { margin: 1.25rem 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-code); overflow: hidden; }
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.4rem;
  padding: 0 .5rem 0 1rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: .75rem;
  font-weight: 500;
  color: var(--muted);
}
.copy {
  font: inherit;
  padding: .25rem .6rem;
  border: 1px solid transparent;
  border-radius: 5px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.copy:hover { color: var(--fg-strong); border-color: var(--line); background: var(--bg); }
.code.bare { position: relative; }
.code.bare .code-head { position: absolute; top: .4rem; right: .4rem; min-height: 0; padding: 0; border: 0; opacity: 0; transition: opacity .15s; }
.code.bare:hover .code-head, .code.bare .copy:focus-visible { opacity: 1; }
.code pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; font-size: .8125rem; line-height: 1.65; tab-size: 4; }
.code code { font-size: inherit; }

.tabs { position: relative; margin: 1.25rem 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-code); overflow: hidden; }
.tabs .code { margin: 0; border: 0; border-radius: 0; }
.tabs .code-head { position: absolute; top: 0; right: .5rem; min-height: 2.5rem; padding: 0; border: 0; }
.tabs .code-head span { display: none; }
.tab-list { display: flex; min-height: 2.5rem; overflow-x: auto; border-bottom: 1px solid var(--line-soft); padding: 0 5rem 0 .5rem; scrollbar-width: none; }
.tab-list button {
  font: inherit;
  font-size: .8rem;
  font-weight: 500;
  padding: .6rem .75rem;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
.tab-list button:hover { color: var(--fg-strong); }
.tab-list button[aria-selected="true"] { color: var(--fg-strong); border-bottom-color: var(--brand); }

/* Syntax highlighting (highlight.js classes) */
.hljs-comment, .hljs-quote { color: light-dark(#6e7781, #8b949e); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-meta .hljs-keyword { color: light-dark(#cf222e, #ff7b72); }
.hljs-string, .hljs-regexp, .hljs-meta .hljs-string { color: light-dark(#0a3069, #a5d6ff); }
.hljs-number, .hljs-literal, .hljs-variable.constant_ { color: light-dark(#0550ae, #79c0ff); }
.hljs-title, .hljs-title.function_, .hljs-section { color: light-dark(#8250df, #d2a8ff); }
.hljs-built_in, .hljs-type, .hljs-title.class_ { color: light-dark(#953800, #ffa657); }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-params { color: light-dark(#1d2936, #e6edf3); }
.hljs-meta, .hljs-symbol { color: light-dark(#116329, #7ee787); }
.hljs-name, .hljs-tag { color: light-dark(#116329, #7ee787); }

/* Tables */
.content table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: .85rem;
  line-height: 1.55;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.content th, .content td { padding: .55rem .65rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.content tr:last-child td { border-bottom: 0; }
.content td code, .content th code { padding: .1em .3em; font-size: .8em; }
.content th { background: var(--bg-soft); color: var(--fg-strong); font-weight: 600; white-space: nowrap; border-bottom-color: var(--line); }
.content th[style*="center"], .content td[style*="center"] { text-align: center; }
.content tbody tr:hover td { background: color-mix(in srgb, var(--bg-soft) 60%, transparent); }

/* Callouts and quotes */
.content blockquote { margin: 1.5rem 0; padding: .1rem 1.25rem; border-left: 3px solid var(--line); color: var(--muted); }
.callout {
  --c: var(--note);
  margin: 1.5rem 0;
  padding: .85rem 1.15rem .15rem;
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  border-left: 4px solid var(--c);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c) 6%, var(--bg));
  font-size: .95rem;
}
.callout.warning { --c: var(--warning); }
.callout-title { margin: 0 0 .35rem !important; font-weight: 650; color: var(--c); font-size: .875rem; }
.callout ul { padding-left: 1.2rem; }

/* Home page */
.home { max-width: 52rem; margin: 0 auto; padding: 4.5rem 2rem 4rem; box-sizing: content-box; }
.home .content { max-width: none; }
.home .content > h1 { font-size: 3rem; margin-bottom: .75rem; }
.home .lead { max-width: 44rem; font-size: 1.25rem; margin-bottom: 1.25rem; }
.home .links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-weight: 500; margin-bottom: 2.5rem; }

/* Pager, edit link and footer */
.pager { max-width: 52rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 4rem; }
.pager a { display: block; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--fg-strong); font-weight: 600; transition: border-color .15s; }
.pager a:hover { border-color: var(--link); text-decoration: none; }
.pager small { display: block; margin-bottom: .15rem; color: var(--muted); font-weight: 400; font-size: .8rem; }
.pager .next { text-align: right; }
.edit { max-width: 52rem; margin: 2rem 0 0; font-size: .85rem; }
.edit a { color: var(--muted); }
.edit a:hover { color: var(--link); }
.site-footer { border-top: 1px solid var(--line-soft); background: var(--bg-soft); font-size: .875rem; color: var(--muted); }
.footer-inner { max-width: 90rem; margin: 0 auto; padding: 3rem 1.5rem; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-inner p { margin: .75rem 0 0; line-height: 1.6; }
.footer-inner .nav-title { margin: 0 0 .6rem; }
.site-footer li { margin: .35rem 0; }
.site-footer ul a { color: var(--muted); }
.site-footer ul a:hover { color: var(--fg-strong); }

/* Search */
dialog.search {
  width: min(40rem, calc(100vw - 2rem));
  max-height: min(34rem, calc(100vh - 6rem));
  margin: 5rem auto auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 24px 64px rgb(0 0 0 / .25);
  overflow: hidden;
}
dialog.search[open] { display: flex; flex-direction: column; }
dialog.search::backdrop { background: rgb(15 23 32 / .45); backdrop-filter: blur(2px); }
.search-box { display: flex; align-items: center; gap: .75rem; padding: 0 1rem; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.search-box input { flex: 1; min-width: 0; padding: 1rem 0; border: 0; outline: 0; background: none; color: var(--fg-strong); font: inherit; font-size: 1rem; }
.search-box input::-webkit-search-cancel-button { display: none; }
.results { list-style: none; margin: 0; padding: .5rem; overflow-y: auto; }
.results:empty { display: none; }
.results a { display: block; padding: .6rem .8rem; border-radius: 6px; color: var(--fg); }
.results a:hover, .results [aria-selected="true"] a { background: var(--accent-bg); text-decoration: none; }
.result-title { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; color: var(--fg-strong); font-size: .925rem; }
.result-title small { font-weight: 400; color: var(--muted); white-space: nowrap; }
.result-text { display: block; margin-top: .15rem; font-size: .825rem; color: var(--muted); line-height: 1.5; }
.results mark { background: none; color: var(--link); font-weight: 600; }
.results .empty { padding: 1.5rem; text-align: center; color: var(--muted); font-size: .9rem; }

/* Responsive */
@media (max-width: 80rem) {
  .shell { grid-template-columns: 16rem minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 60rem) {
  .top-links { display: none; }
  .search-button { width: auto; }
  .search-button kbd { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 48rem) {
  :root { --header: 3.5rem; }
  .shell { display: block; }
  .menu { display: inline-grid; }
  .top-inner { padding: 0 1rem; gap: .25rem; }
  .search-button { border: 0; background: none; padding: .4rem; }
  .search-button span { display: none; }
  .sidebar {
    display: none;
    position: fixed;
    inset: var(--header) 0 0;
    height: calc(100dvh - var(--header));
    max-height: none;
    z-index: 15;
    background: var(--bg);
    border: 0;
    padding: 1.5rem;
  }
  .nav-open .sidebar { display: block; }
  .nav-open { overflow: hidden; }
  main { padding: 1.75rem 1.25rem 3rem; }
  .content h1 { font-size: 1.85rem; }
  .home { padding: 2.5rem 1.25rem; }
  .home .content > h1 { font-size: 2.25rem; }
  .pager { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; padding: 2rem 1.25rem; }
}
@media print {
  .top, .sidebar, .toc, .pager, .edit, .site-footer, .copy, .anchor { display: none !important; }
  .shell { display: block; }
}
