/* Heft website. No external fonts, scripts or trackers. */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --bg-card: #ffffff;
  --text: #1b1f24;
  --muted: #59626e;
  --border: #e2e6eb;
  --accent: #2f6fe0;
  --accent-hover: #245bc0;
  --accent-ink: #ffffff;
  --code-bg: #f1f3f6;
  --note-bg: #edf3ff;
  --note-border: #9dbcf5;
  --warn-bg: #fff7e8;
  --warn-border: #e8b04a;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.08);
  --blue: #4a8af0;
  --red: #e5534b;
  --green: #4cc46a;
  --yellow: #f2c230;
  --purple: #b067e8;
  --radius: 10px;
  --max: 1120px;
  --prose: 760px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --bg-soft: #151a20;
    --bg-card: #171c23;
    --text: #e5e8ec;
    --muted: #a1a9b4;
    --border: #28303a;
    --accent: #6c9ef8;
    --accent-hover: #8db4ff;
    --accent-ink: #0b1220;
    --code-bg: #1c222a;
    --note-bg: #142035;
    --note-border: #35568f;
    --warn-bg: #2a2111;
    --warn-border: #8a6720;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 1.8em 0 0.5em;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 2.2rem;
  margin-top: 0;
}
h2 {
  font-size: 1.55rem;
}
h3 {
  font-size: 1.2rem;
}
h2 .anchor,
h3 .anchor {
  visibility: hidden;
  text-decoration: none;
  margin-left: 0.3em;
  color: var(--muted);
}
h2:hover .anchor,
h3:hover .anchor {
  visibility: visible;
}

p,
ul,
ol {
  margin: 0 0 1em;
}
li {
  margin: 0.25em 0;
}

code,
kbd,
pre {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
}
code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
pre {
  background: var(--code-bg);
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.5;
  position: relative;
}
pre code {
  background: none;
  padding: 0;
}
kbd {
  display: inline-block;
  padding: 0.05em 0.45em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-soft);
  font-size: 0.82em;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 0.95em;
}
th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-weight: 600;
  color: var(--muted);
}
.table-wrap {
  overflow-x: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 100;
  background: var(--bg);
  padding: 6px 10px;
  border-radius: 6px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.brand:hover {
  color: var(--text);
}
.brand img {
  width: 28px;
  height: 28px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px 18px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}
.site-nav a.btn-primary,
.site-nav a.btn-primary:hover {
  color: var(--accent-ink);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.3;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}
.btn-secondary {
  border-color: var(--border);
  color: var(--text);
  background: var(--bg-card);
}
.btn-secondary:hover {
  color: var(--text);
  border-color: var(--muted);
}
.btn-small {
  padding: 6px 12px;
  font-size: 0.9rem;
}

/* Landing page */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 16px 24px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.025em;
  max-width: 820px;
  margin: 0 auto 16px;
}
.hero .lede {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto 28px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero-meta {
  color: var(--muted);
  font-size: 0.9rem;
}
.blocks {
  display: inline-grid;
  grid-template-columns: 34px 16px 16px;
  grid-template-rows: 20px 12px 12px;
  gap: 3px;
  margin-bottom: 22px;
}
.blocks span {
  border-radius: 3px;
}
.blocks .b1 {
  grid-row: 1 / 4;
  background: var(--blue);
}
.blocks .b2 {
  grid-column: 2 / 4;
  background: var(--red);
}
.blocks .b3 {
  grid-column: 2 / 4;
  background: var(--green);
}
.blocks .b4 {
  background: var(--yellow);
}
.blocks .b5 {
  background: var(--purple);
}

.shot {
  margin: 0;
}
.shot img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #fff;
}
.shot figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 10px;
  text-align: center;
}
.hero-shot {
  max-width: var(--max);
  margin: 24px auto 0;
  padding: 0 16px;
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 16px 0;
}
.section > h2 {
  text-align: center;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  margin: 0 0 8px;
}
.section > .sub {
  text-align: center;
  color: var(--muted);
  max-width: 660px;
  margin: 0 auto 36px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.card .card-body {
  padding: 16px 18px 18px;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0 8px;
  margin-bottom: 8px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 40px;
  align-items: center;
}
.split.reverse > :first-child {
  order: 2;
}
.split h2 {
  margin-top: 0;
}
@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .split.reverse > :first-child {
    order: 0;
  }
}

.checks {
  list-style: none;
  padding: 0;
}
.checks li {
  position: relative;
  padding-left: 28px;
  margin: 0.55em 0;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 12px;
  height: 7px;
  border-left: 2.5px solid var(--green);
  border-bottom: 2.5px solid var(--green);
  transform: rotate(-45deg);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.stat {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat .num {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stat p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.cta {
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px 20px;
}
.cta h2 {
  margin-top: 0;
}

/* Docs layout */

.docs {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 16px 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
}
.sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
  font-size: 0.94rem;
}
.sidebar h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 8px;
}
.sidebar h2:not(:first-child) {
  margin-top: 22px;
}
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar li {
  margin: 0;
}
.sidebar a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.sidebar a:hover {
  background: var(--bg-soft);
}
.sidebar a[aria-current="page"] {
  background: var(--note-bg);
  color: var(--accent);
  font-weight: 600;
}
.prose {
  max-width: var(--prose);
  min-width: 0;
}
.prose .lede {
  font-size: 1.15rem;
  color: var(--muted);
}
.prose figure.shot {
  margin: 1.4em 0 1.8em;
}
.prose figure.shot figcaption {
  text-align: left;
}
.prose h2 {
  padding-top: 0.6em;
  border-top: 1px solid var(--border);
}
.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.breadcrumb a {
  color: var(--muted);
}
.platforms {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 10px;
  margin-bottom: 12px;
}
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 1.6em;
  font-size: 0.95rem;
}
.toc strong {
  display: block;
  margin-bottom: 4px;
}
.toc ol,
.toc ul {
  margin: 0;
  padding-left: 20px;
}
@media (max-width: 860px) {
  .docs {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 20px;
  }
  .sidebar {
    position: static;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
  }
  .sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
  }
}

.note,
.warn {
  border-left: 4px solid var(--note-border);
  background: var(--note-bg);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 1.2em;
}
.warn {
  border-left-color: var(--warn-border);
  background: var(--warn-bg);
}
.note p:last-child,
.warn p:last-child {
  margin-bottom: 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin: 0 0 1.1em;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
h2.step-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
h2.step-title .n {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 48px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.pager a {
  display: block;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
}
.pager a:hover {
  border-color: var(--accent);
}
.pager small {
  display: block;
  color: var(--muted);
}
.pager .next {
  text-align: right;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
  margin: 0 0 10px;
  background: var(--bg-card);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
}
.faq details[open] summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font: inherit;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--muted);
  cursor: pointer;
}
.copy:hover {
  color: var(--text);
}

/* Footer */

.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 16px 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.footer-inner a {
  color: var(--muted);
}
.footer-inner a:hover {
  color: var(--text);
}
