/* Function Injection: the site. A dark ground, JetBrains Mono for headings, code and numbers, Inter for text,
   numbered sections with ruled tables and lists. The fonts are served from here, not from a font service. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --ground: #0b0d0e;
  --surface: #14171a;
  --code: #111417;
  --line: #262b30;
  --line-strong: #3a4048;
  --row: #1c2024;
  --text: #e8eaed;
  --body: #b8c0c8;
  --muted: #9aa3ad;
  --faint: #7c8590;
  --accent: #b6f35c;
  --accent-hover: #d4fa9a;

  --syntax-type: #8ab4f8;
  --syntax-attribute: #c792ea;
  --syntax-string: #f2c27a;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 8px;
  --width: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

code,
pre {
  font-family: var(--mono);
  /* No ligatures in code: => and -- stay the characters a reader types. */
  font-variant-ligatures: none;
}

.container {
  max-width: var(--width);
  margin: 0 auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--ground);
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 1;
}

.skip-link:focus {
  top: 16px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
}

/* The mark of the favicon: the f of a function and its dot, on the surface of the code windows. */
.brand-mark {
  flex: none;
}

.brand-mark rect {
  fill: var(--surface);
  stroke: var(--line-strong);
}

.brand-mark path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
}

.brand-mark circle {
  fill: var(--accent);
}

.brand:hover {
  color: var(--text);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 14px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
}

/* Hero */

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: flex-start;
  padding-block: 80px 72px;
}

.hero-text {
  flex: 999 1 540px;
  min-width: 0;
}

.eyebrow,
.section-number {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}

.hero h1 {
  margin: 20px 0 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 14ch;
}

.lead {
  margin: 24px 0 0;
  max-width: 58ch;
  font-size: 19px;
  color: var(--body);
}

.actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.button-primary {
  background: var(--accent);
  color: var(--ground);
}

.button-primary:hover {
  background: var(--accent-hover);
  color: var(--ground);
}

.button-secondary {
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 500;
}

.button-secondary:hover {
  border-color: var(--muted);
  color: var(--text);
}

/* The datasheet next to the hero */

.facts {
  /* Wide enough for the install command, next to the title on a desktop. */
  flex: 1 1 420px;
  /* Narrower than the install command: the command scrolls in its box, not the page. */
  min-width: 0;
  margin: 0;
  border-top: 2px solid var(--text);
  font-size: 14px;
}

.facts > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-family: var(--mono);
  text-align: right;
}

.install {
  display: block;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  overflow-x: auto;
  white-space: nowrap;
}

.prompt {
  color: var(--faint);
  user-select: none;
}

/* Sections */

.section {
  border-top: 1px solid var(--line);
}

.section > .container {
  padding-block: 64px;
}

.section h2 {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.01em;
}

.section-intro {
  margin: 12px 0 28px;
  max-width: 64ch;
  color: var(--body);
}

/* Code */

.code-window {
  background: var(--code);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-title {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.code-title .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.code-title .dot:last-of-type {
  margin-right: 8px;
}

.code-window pre {
  margin: 0;
  padding: 24px 28px;
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.75;
}

.k { color: var(--accent); }
.t { color: var(--syntax-type); }
.a { color: var(--syntax-attribute); }
.s { color: var(--syntax-string); }
.c { color: var(--faint); }

/* Benchmarks */

.table-scroll {
  overflow-x: auto;
  border-top: 2px solid var(--text);
}

.benchmarks {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 15px;
}

.benchmarks thead th {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
  text-align: right;
}

.benchmarks tbody th,
.benchmarks td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--row);
  font-weight: 400;
  text-align: right;
}

.benchmarks thead th:first-child,
.benchmarks tbody th {
  text-align: left;
}

.benchmarks tbody tr:last-child > * {
  border-bottom: 0;
}

.benchmarks .highlight {
  background: var(--surface);
  color: var(--accent);
}

.benchmarks .highlight > * {
  font-weight: 700;
}

.notes {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 24px;
}

.notes h3,
.features h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.notes p,
.features p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.source {
  margin: 28px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* What comes with it */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 0 32px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.features li {
  border-top: 2px solid var(--text);
  padding: 16px 0 32px;
}

.features h3 {
  font-size: 17px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  padding-block: 24px;
  font-size: 14px;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer .links {
  display: flex;
  gap: 20px;
}
