/* The styles of the site, on the tokens of the design system (design-system/tokens.css). The home page came from
   round 1 of the copy, variation v1. Each value is a token. */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font: var(--weight-body) var(--text-base)/var(--leading-body) var(--font-body); }
a { color: var(--color-accent); }
code { font-family: var(--font-mono); font-size: var(--text-sm); }
/* A long name in a line of text breaks, so that it does not go past the edge of a phone. A block of code scrolls instead. */
:not(pre) > code { overflow-wrap: break-word; }
/* Code in a line of text: a green tint and a hairline border, so that it stands out from the page and from a surface. */
:not(pre) > code { background: var(--color-code-inline); border: var(--line) solid var(--color-code-inline-border); border-radius: var(--radius-xs); padding: 0 var(--space-1); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.wrap { max-width: var(--page-max); margin: 0 auto; padding-inline: var(--gutter); }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--weight-display); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); margin: 0 0 var(--space-4); text-wrap: balance; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h3 code { font-size: inherit; }
p { max-width: var(--measure); margin: 0 0 var(--space-4); }
.muted { color: var(--color-muted); }
:focus-visible { outline: var(--focus-ring) solid var(--color-accent); outline-offset: var(--line-strong); }

/* Brand: the mark inline, so that it follows the theme */
.brand { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text); text-decoration: none; font: var(--weight-display) var(--text-xl)/var(--leading-tight) var(--font-display); letter-spacing: var(--tracking-display); }
.brand .wordmark span { color: var(--color-accent); }
.mark { width: var(--mark-size); height: var(--mark-size); flex: none; fill: none; stroke-width: var(--mark-stroke); stroke-linecap: round; stroke-linejoin: round; }
.mark .brace { stroke: var(--color-accent); }
.mark .check { stroke: var(--color-highlight-ink); }

/* Site navigation */
.site-nav { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-8); align-items: center; justify-content: space-between; padding-block: var(--space-6); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); list-style: none; margin: 0; padding: 0; }
.site-nav a:not(.brand) { color: var(--color-text); text-decoration: none; font-weight: var(--weight-medium); font-size: var(--text-sm); }
.site-nav a:not(.brand):hover { color: var(--color-accent); }
.site-nav li { display: flex; align-items: center; }
/* An icon of the navigation (Lucide), before the text of its link, in the colour of the text. */
.site-nav a:not(.brand) { display: inline-flex; align-items: center; gap: var(--space-1); }
.site-nav a .icon { width: var(--space-4); height: var(--space-4); flex: none; fill: none; stroke: currentColor; stroke-width: var(--line-strong); stroke-linecap: round; stroke-linejoin: round; }
/* The GitHub mark: a filled icon with no text, as large as a line of the navigation. */
.site-nav a.github .icon { width: var(--text-lg); height: var(--text-lg); fill: currentColor; stroke: none; }

/* The theme switch: a moon in the light theme, a sun in the dark theme. It is pressed when the page is dark. */
.theme-switch { display: inline-flex; align-items: center; justify-content: center; width: var(--space-8); height: var(--space-8); padding: 0; border: var(--line) solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text); cursor: pointer; }
.theme-switch:hover { color: var(--color-accent); border-color: var(--color-accent); }
.theme-switch .icon { width: var(--space-4); height: var(--space-4); fill: none; stroke: currentColor; stroke-width: var(--line-strong); stroke-linecap: round; stroke-linejoin: round; }
.theme-switch[aria-pressed="true"] .moon, .theme-switch[aria-pressed="false"] .sun { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-6); border-radius: var(--radius-pill); border: var(--line-strong) solid transparent; font: var(--weight-bold) var(--text-base)/var(--leading-tight) var(--font-body); cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--color-accent); color: var(--color-accent-text); }
.btn-secondary { background: transparent; color: var(--color-text); border-color: var(--color-text); }
.btn-primary:hover { box-shadow: var(--shadow-card); }
.btn-secondary:hover { background: var(--color-accent-soft); }
/* A call to action in text: a link with an arrow before it. The arrow says that the link starts a task. */
.cta-link { display: inline-flex; gap: var(--space-2); align-items: baseline; color: var(--color-accent); font-size: var(--text-lg); font-weight: var(--weight-bold); text-decoration: none; }
.cta-link:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); align-items: center; }

/* Hero: what rego4k is, the call to action, and the stops of the tour */
.hero { display: grid; gap: var(--space-12); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--column-min)), 1fr)); align-items: center; padding-block: var(--space-8) var(--space-16); }
.hero h1 { font-size: var(--text-3xl); line-height: var(--leading-display); margin-bottom: var(--space-6); }
mark { background: linear-gradient(transparent 16%, var(--color-highlight) 16%, var(--color-highlight) 88%, transparent 88%); color: var(--color-highlight-text); padding-inline: var(--space-2); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.lede { font-size: var(--text-lg); margin-bottom: var(--space-8); }
.lede code { font-size: var(--text-base); }
.lede + .lede { margin-top: calc(-1 * var(--space-3)); }
.tour-index { background: var(--color-surface); border: var(--line) solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6) var(--space-8); }
.tour-index p { margin-bottom: var(--space-3); font-size: var(--text-sm); }
.tour-index ol { margin: 0; padding: 0; list-style: none; counter-reset: stop; }
.tour-index li { counter-increment: stop; border-top: var(--line) solid var(--color-border); }
.tour-index a { display: flex; gap: var(--space-4); padding-block: var(--space-2); color: var(--color-text); text-decoration: none; font-weight: var(--weight-medium); }
.tour-index a::before { content: counter(stop); font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-accent); min-width: var(--space-4); }
.tour-index a:hover { color: var(--color-accent); }
/* "…and more" after the numbered stops: no number, but the text lines up with the labels of the stops. */
.tour-index .more { margin: 0; border-top: var(--line) solid var(--color-border); }
.tour-index .more a { padding-inline-start: calc(var(--space-4) + var(--space-4)); color: var(--color-muted); }
.tour-index .more a::before { content: none; }

/* The tour: one band for each property */
.tour-head { border-top: var(--line-strong) solid var(--color-text); padding-top: var(--space-8); }
.band { display: grid; gap: var(--space-8); align-items: start; padding-block: var(--space-16); border-bottom: var(--line) solid var(--color-border); }
.band > * { min-width: 0; }
.band-text p:last-child { margin-bottom: 0; }
.band-wide .band-text { display: grid; gap: var(--space-4) var(--space-12); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--column-min)), 1fr)); align-items: start; }
.band-wide .band-text h3 { font-size: var(--text-2xl); margin: 0; }
.band-surface { background: var(--color-surface); border: var(--line) solid var(--color-border); border-radius: var(--radius-lg); padding-inline: var(--space-8); margin-block: var(--space-16); }

/* 60rem: the width at which a band puts its text and its example side by side. A raw value is allowed for a breakpoint. */
@media (min-width: 60rem) {
  .band-split { grid-template-columns: 5fr 7fr; align-items: center; }
  .band-split.flip { grid-template-columns: 7fr 5fr; }
  .band-split.flip > .band-example { order: -1; }
  .band-narrow { grid-template-columns: 4fr 8fr; }
  /* The headline gets the wider column, so that the buttons are in the first screen at 1440 x 900. */
  .hero { grid-template-columns: 7fr 5fr; }
}

/* Code block: a solid green block, with a file name and no window controls */
.code { margin: 0; background: var(--color-block); color: var(--color-block-text); border-radius: var(--radius-lg); padding: var(--space-6) var(--space-8) var(--space-8); box-shadow: var(--shadow-card); min-width: 0; }
.code + .code { margin-top: var(--space-4); }
.code figcaption { font: var(--weight-medium) var(--text-xs)/var(--leading-tight) var(--font-mono); color: var(--color-block-muted); padding-bottom: var(--space-4); margin-bottom: var(--space-4); border-bottom: var(--line) solid var(--color-block-muted); display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.code pre { margin: 0; overflow-x: auto; tab-size: 4; font: var(--weight-body) var(--text-sm)/var(--leading-code) var(--font-mono); }
.code .kw { color: var(--color-code-keyword); }
.code .str { color: var(--color-code-string); }
.code .cm { color: var(--color-block-muted); }
.code .code-source { display: block; margin-top: var(--space-4); padding-top: var(--space-4); border-top: var(--line) solid var(--color-block-muted); font: var(--weight-medium) var(--text-xs)/var(--leading-tight) var(--font-mono); color: var(--color-block-muted); overflow-wrap: anywhere; }
.code .code-source:hover { color: var(--color-block-text); }

/* Screenshot: an image of the product at its own aspect, with a frame. A screenshot has an image for each theme (classes
   `light` and `dark`), and the page shows the one of its theme: the choice of the theme switch, or else the system. */
.screenshot { margin: 0; }
.screenshot img { display: block; width: 100%; height: auto; border: var(--line) solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.screenshot img.dark, :root[data-theme="dark"] .screenshot img.light { display: none; }
:root[data-theme="dark"] .screenshot img.dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .screenshot img.light { display: none; }
  :root:not([data-theme="light"]) .screenshot img.dark { display: block; }
}

/* Ledger: two rows that compare what each engine brings into an image */
.ledger { margin: 0; display: grid; gap: var(--space-6); }
.ledger > div { border-top: var(--line-strong) solid var(--color-text); padding-top: var(--space-4); }
.ledger dt { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-2); }
.ledger dd { margin: 0; }
.ledger .count { display: block; font: var(--weight-display) var(--text-2xl)/var(--leading-display) var(--font-display); letter-spacing: var(--tracking-display); margin-bottom: var(--space-2); }
.ledger .rego4k { border-top-color: var(--color-accent); }
.ledger .rego4k .count { color: var(--color-accent); }

/* Table of the kinds of builtins */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { text-align: left; vertical-align: top; padding: var(--space-3) var(--space-4) var(--space-3) 0; border-bottom: var(--line) solid var(--color-border); }
thead th { font-weight: var(--weight-bold); border-bottom: var(--line-strong) solid var(--color-text); }
td code, th code { font-size: var(--text-xs); }
.band-example > .table-wrap + .code { margin-top: var(--space-6); }

/* Steps of a signed decision */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: var(--space-3); }
.steps li { counter-increment: step; display: grid; grid-template-columns: var(--space-8) 1fr; gap: var(--space-4); align-items: baseline; padding: var(--space-4) var(--space-6); background: var(--color-surface); border: var(--line) solid var(--color-border); border-radius: var(--radius-md); }
.steps li::before { content: counter(step); font-family: var(--font-mono); font-weight: var(--weight-bold); color: var(--color-accent); }

/* A chip: the name of a module, as a link to its section of the docs. The code inside a chip has no box of its own.
   The name of a module in a heading, or in the text of another link, is a chip too: a `code` with the class `chip`. */
.chip { display: inline-block; font: var(--weight-medium) var(--text-xs)/var(--leading-tight) var(--font-mono); color: var(--color-accent); background: var(--color-accent-soft); border: var(--line) solid var(--color-code-inline-border); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); text-decoration: none; white-space: nowrap; }
a.chip:hover { border-color: var(--color-accent); }
.chip code { font: inherit; background: none; border: 0; padding: 0; color: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-4); padding: 0; list-style: none; }

/* Proof: measured facts on a ruled strip */
.proof { padding-block: var(--space-24) var(--space-16); }
.facts { list-style: none; margin: 0; padding: var(--space-8); display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--fact-min)), 1fr)); background: var(--color-surface); border: var(--line) solid var(--color-border); border-radius: var(--radius-lg); }
.facts li { border-top: var(--line-strong) solid var(--color-accent); padding-top: var(--space-4); }
.facts li > strong { display: block; font: var(--weight-display) var(--text-2xl)/var(--leading-display) var(--font-display); letter-spacing: var(--tracking-display); margin-bottom: var(--space-2); }
.facts p { margin: 0; font-size: var(--text-sm); color: var(--color-muted); }
.facts-note { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--color-muted); }

/* Getting started: the paths, and the build file */
.start { padding-block: var(--space-16) var(--space-24); }
.start-grid { display: grid; gap: var(--space-12); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--column-min)), 1fr)); align-items: start; }
.paths { list-style: none; margin: 0; padding: 0; }
.paths > li { border-top: var(--line) solid var(--color-border); padding-block: var(--space-6); }
.paths > li:first-child { border-top: var(--line-strong) solid var(--color-text); }
.paths h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.paths p { margin-bottom: var(--space-3); color: var(--color-muted); }
.paths .chips { margin-bottom: var(--space-4); }

/* Footer */
.site-footer { border-top: var(--line-strong) solid var(--color-text); padding-block: var(--space-12) var(--space-16); font-size: var(--text-sm); }
.footer-grid { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--card-min)), 1fr)); }
.site-footer h2 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.site-footer a:not(.brand) { color: var(--color-text); }

/* A page from Markdown: the article, and the list of the pages beside it */
.doc { display: grid; gap: var(--space-12); padding-block: var(--space-8) var(--space-24); }
.doc > * { min-width: 0; }
/* 60rem: the width at which the list of the pages goes beside the article. A raw value is allowed for a breakpoint. */
@media (min-width: 60rem) {
  .doc { grid-template-columns: minmax(0, 1fr) var(--card-min); }
}
.doc-nav { font-size: var(--text-sm); }
.doc-nav h2 { font-size: var(--text-lg); margin: var(--space-8) 0 var(--space-3); }
.doc-nav h2:first-child { margin-top: 0; }
.doc-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.doc-nav a { color: var(--color-text); text-decoration: none; }
.doc-nav a:hover, .doc-nav a[aria-current="page"] { color: var(--color-accent); }
.doc-nav a[aria-current="page"] { font-weight: var(--weight-bold); }

/* A page of the docs: the sidebar of the sections, and the article. The sidebar goes before the article at 60rem. */
.docs { display: grid; gap: var(--space-12); padding-block: var(--space-8) var(--space-24); }
.docs > * { min-width: 0; }
@media (min-width: 60rem) {
  .docs { grid-template-columns: var(--card-min) minmax(0, 1fr); }
  .docs-nav { order: -1; position: sticky; top: var(--space-8); align-self: start; max-height: calc(100vh - var(--space-16)); overflow-y: auto; }
}
.docs-nav { font-size: var(--text-sm); }
.docs-label { font: var(--weight-medium) var(--text-xs)/var(--leading-tight) var(--font-mono); color: var(--color-muted); margin: 0 0 var(--space-4); }
.docs-nav h2 { font-size: var(--text-base); margin: var(--space-6) 0 var(--space-2); }
.docs-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.docs-nav a { color: var(--color-text); text-decoration: none; }
.docs-nav a:hover, .docs-nav a[aria-current="page"] { color: var(--color-accent); }
.docs-nav a[aria-current="page"] { font-weight: var(--weight-bold); }

/* The index of the modules on the page of the modules: in the sidebar from 60rem, under the entry of the page, and
   above the article below 60rem, as a list that opens. The names in the sidebar are not chips: a chip does not fit the
   width of the sidebar. */
.module-group { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-muted); margin: var(--space-3) 0 var(--space-1); }
.docs-nav .module-index { margin: var(--space-2) 0 var(--space-2) var(--space-3); padding-left: var(--space-3); border-left: var(--line) solid var(--color-border); }
.docs-nav .module-index ul { gap: var(--space-1); }
.docs-nav .module-index a { font: var(--weight-body) var(--text-xs)/var(--leading-tight) var(--font-mono); overflow-wrap: anywhere; }
.module-index-top { background: var(--color-surface); border: var(--line) solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.module-index-top summary { cursor: pointer; font-weight: var(--weight-bold); }
.module-index-top ul { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.module-index-top .chip { white-space: normal; overflow-wrap: anywhere; }
@media (min-width: 60rem) {
  .module-index-top { display: none; }
}
@media not all and (min-width: 60rem) {
  .docs-nav .module-index { display: none; }
}

.prose h1 { font-size: var(--text-2xl); line-height: var(--leading-tight); margin-bottom: var(--space-8); }
.prose h2 { font-size: var(--text-xl); margin-top: var(--space-16); padding-top: var(--space-6); border-top: var(--line-strong) solid var(--color-text); }
.prose h3 { font-size: var(--text-lg); margin-top: var(--space-12); }
.prose h4 { font-size: var(--text-base); margin-top: var(--space-8); }
.prose h2 code, .prose h3 code, .prose h4 code { font-size: inherit; }
/* A chip in a heading has the weight of the heading. It is smaller than the heading, because the mono font is wide, and
   a long name can break, so that it fits a phone. */
.prose h2 .chip, .prose h3 .chip, .prose h4 .chip { font-size: var(--text-base); font-weight: inherit; white-space: normal; overflow-wrap: anywhere; }
.prose ul, .prose ol { max-width: var(--measure); margin: 0 0 var(--space-4); padding-left: var(--space-6); }
.prose li { margin-bottom: var(--space-2); }
.prose li > ul, .prose li > ol { margin: var(--space-2) 0 0; }
.prose .code { margin-block: var(--space-6) var(--space-8); }
.prose table { display: block; overflow-x: auto; margin-block: var(--space-6) var(--space-8); }
.prose blockquote { margin: 0 0 var(--space-4); border-left: var(--focus-ring) solid var(--color-highlight); padding: var(--space-2) var(--space-4); background: var(--color-surface); border-radius: var(--radius-sm); max-width: var(--measure); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose .screenshot { margin-block: var(--space-6) var(--space-8); }

/* Tree shaking on the home page: the files before the shake, and after it. One column, and two from 60rem. A column
   has a minimum width of 0, so that a long line of code scrolls in its block and the page does not scroll sideways. */
.before-after { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.before-after .label { margin: 0 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-muted); }
@media (min-width: 60rem) {
  .before-after { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
