@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --paper: #f7f5f0;
  --card: #fffdf9;
  --ink: #1b1915;
  --soft: #625d53;
  --line: #dfdacf;
  --code: #efebe2;
  /* One colour for each kind of field. A word and its chip share it. */
  --enum: #3d5bd9;
  --relation: #1f7a4d;
  --number: #b4540a;
  --date: #b0306a;
  --boolean: #0f7480;
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14130f;
    --card: #1c1a16;
    --ink: #f1ede4;
    --soft: #a8a294;
    --line: #34312a;
    --code: #23211c;
    --enum: #8ea2ff;
    --relation: #5fc08e;
    --number: #f0a35e;
    --date: #f07fae;
    --boolean: #57c4d0;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
}
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--enum); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.top, main, footer { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: 1.5rem; flex-wrap: wrap; }
.name { font: 600 0.95rem var(--mono); text-decoration: none; }
.top nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--soft); }
.top nav a:hover { color: var(--ink); }

.hero { padding: 4.5rem 0 2.5rem; }
.eyebrow { margin: 0 0 1rem; font: 500 0.8rem var(--mono); color: var(--soft); }
h1 { margin: 0; max-width: 20ch; font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.04; letter-spacing: -0.03em; font-weight: 700; text-wrap: balance; }
.lede { margin: 1.5rem 0 0; max-width: 62ch; font-size: 1.12rem; color: var(--soft); text-wrap: pretty; }

/* Demo */
.demo { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; }
.box { display: flex; align-items: center; gap: 0.7rem; min-height: 3.4rem; padding: 0.7rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.box svg { flex: none; width: 1.1rem; height: 1.1rem; fill: var(--soft); }
.query { margin: 0; font: 500 clamp(0.95rem, 2.6vw, 1.15rem)/1.9 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.word { border-bottom: 2px solid var(--k); padding-bottom: 1px; transition: background-color 0.15s; border-radius: 2px 2px 0 0; }
.word.lit { background: color-mix(in srgb, var(--k) 22%, transparent); }
.caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 1px; background: var(--ink); vertical-align: text-bottom; animation: blink 1s steps(2) infinite; }
[data-kind="enum"] { --k: var(--enum); }
[data-kind="relation"] { --k: var(--relation); }
[data-kind="number"] { --k: var(--number); }
[data-kind="date"] { --k: var(--date); }
[data-kind="boolean"] { --k: var(--boolean); }
[data-kind="text"], [data-kind="sort"] { --k: var(--soft); }

.read { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; min-height: 2.9rem; padding: 0.7rem 0.25rem 0.5rem; }
.showing { font-size: 0.8rem; color: var(--soft); }
.read ul { display: contents; list-style: none; }
.chip { display: inline-flex; align-items: center; border: 1px solid color-mix(in srgb, var(--k) 45%, var(--line)); background: color-mix(in srgb, var(--k) 9%, var(--card)); color: var(--ink); border-radius: 999px; font-size: 0.86rem; font-weight: 500; animation: drop 0.28s ease-out both; }
.chip[data-kind="text"], .chip[data-kind="sort"] { border-style: dashed; background: transparent; }
.chip span { padding: 0.15rem 0.2rem 0.15rem 0.7rem; }
.chip button { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; padding: 0; border: 0; border-radius: 999px; background: none; color: inherit; opacity: 0.55; cursor: pointer; }
.chip button:hover { opacity: 1; }
.chip svg { width: 0.9rem; height: 0.9rem; fill: currentColor; }
.count { margin-left: auto; font: 500 0.8rem var(--mono); color: var(--soft); }

.table { overflow-x: auto; border-top: 1px solid var(--line); min-height: 15.5rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font: 500 0.72rem var(--mono); color: var(--soft); text-transform: uppercase; letter-spacing: 0.06em; padding: 0.7rem 0.75rem 0.4rem 0.25rem; white-space: nowrap; }
td { padding: 0.5rem 0.75rem 0.5rem 0.25rem; border-top: 1px solid var(--line); white-space: nowrap; }
td:nth-child(4), th:nth-child(4) { text-align: right; font-variant-numeric: tabular-nums; }
td:nth-child(5) { font-variant-numeric: tabular-nums; color: var(--soft); }
td.none, td.more { color: var(--soft); white-space: normal; }
tbody { display: table-row-group; }

.try { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.try p { margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--soft); }
/* One line that scrolls sideways. The edge fades where more examples are hidden. */
.examples { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; padding-right: 2.5rem; mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
.examples::-webkit-scrollbar { display: none; }
.examples button { flex: none; white-space: nowrap; font: 500 0.74rem var(--mono); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.25rem 0.55rem; cursor: pointer; text-align: left; }
.examples button:hover { border-color: var(--soft); }
.examples button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.note { margin: 1rem 0 0; font-size: 0.82rem; color: var(--soft); max-width: 75ch; }

/* Sections */
section h2 { margin: 0 0 1.5rem; font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1.15; }
.steps, .facts, .status { padding-top: 4.5rem; }
.steps ol { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 2rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 0.75rem; }
.steps li::before { content: counter(step); grid-row: 1 / span 9; font: 600 0.9rem var(--mono); color: var(--soft); padding-top: 0.2rem; }
.steps li > * { grid-column: 2; }
h3 { margin: 0 0 0.6rem; font-size: 1.1rem; }
.steps p { margin: 0.6rem 0 0; color: var(--soft); max-width: 65ch; }
pre { margin: 0 0 0.5rem; padding: 0.9rem 1rem; background: var(--code); border-radius: 8px; overflow-x: auto; font: 0.82rem/1.6 var(--mono); }
code, .query, .examples button { font-variant-ligatures: none; }
code { font-family: var(--mono); font-size: 0.88em; }
p code, dd code { background: var(--code); padding: 0.1em 0.35em; border-radius: 4px; }
.next { margin: 2rem 0 0; display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.button { display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; padding: 0.6rem 1.1rem; border-radius: 8px; }
.button:hover { opacity: 0.88; }

.facts dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.facts dl div { padding: 1.25rem 1.5rem 1.25rem 0; border-bottom: 1px solid var(--line); }
dt { font-weight: 650; margin-bottom: 0.3rem; }
dd { margin: 0; color: var(--soft); font-size: 0.95rem; }
.status p { max-width: 65ch; color: var(--soft); margin: 0; }

footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 2rem; margin-top: 5rem; padding-top: 1.5rem; padding-bottom: 3rem; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--soft); }
footer p { margin: 0; display: flex; gap: 1.25rem; }

@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .chip, .caret { animation: none; } }
@media (max-width: 34rem) {
  .hero { padding-top: 3rem; }
  .demo { padding: 0.9rem; margin: 0 -0.25rem; }
  .steps li { grid-template-columns: 1.6rem minmax(0, 1fr); }
  .count { margin-left: 0; width: 100%; }
}
