/* Acahti product site. Tokens, type and shell follow the Acahti web app
   (acahti-web src/styles/tokens.css): Geist, the indigo primary, a sidebar-grey
   frame around one white inset page. The theme follows the system. */

@font-face {
  font-family: "Geist Variable";
  src: url("/assets/geist-latin-wght-normal.19f9c925.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono Variable";
  src: url("/assets/geist-mono-latin-wght-normal.684ad5b5.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --background: #fff;
  --foreground: #0a0a0a;
  --primary: #4f46e5;
  --primary-foreground: #fff;
  --muted: #f5f5f5;
  --muted-foreground: #6b7080;
  --accent: #f5f5f5;
  --border: #e6e7eb;
  --ring: color-mix(in oklab, #4f46e5 55%, transparent);
  --sidebar: #f5f6f8;
  --sidebar-accent: #eceef2;
  --code-bg: #f7f8fa;
  --radius: 0.625rem;
  --sans: "Geist Variable", -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "Geist Mono Variable", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --header: 3.5rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0c0d10;
    --foreground: #fafafa;
    --primary: #8b8cf8;
    --primary-foreground: #0c0d1a;
    --muted: #262626;
    --muted-foreground: #a1a1a1;
    --accent: #262626;
    --border: #ffffff1a;
    --ring: color-mix(in oklab, #8b8cf8 55%, transparent);
    --sidebar: #101114;
    --sidebar-accent: #262626;
    --code-bg: #15161a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 1rem); }
body { margin: 0; background: var(--sidebar); color: var(--foreground); font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
code { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code { background: var(--muted); border-radius: 0.375rem; padding: 0.125em 0.375em; overflow-wrap: anywhere; }
pre { margin: 1.25em 0 0; padding: 0.875rem 1rem; overflow-x: auto; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); font: 400 13px/1.65 var(--mono); }
pre code { font-size: inherit; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 20; background: var(--background); padding: 0.5rem 0.75rem; }

/* The header, as in the app: brand left, actions right. */
.top { position: sticky; top: 0; z-index: 10; height: var(--header); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1rem; background: var(--sidebar); }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--foreground); text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.mark { width: 22px; height: 22px; }
/* The latest release next to the brand; it opens the release notes. */
.version { margin: 0 auto 0 -0.5rem; padding: 1px 0.5rem; border-radius: 999px; border: 1px solid var(--border); background: var(--background); color: var(--muted-foreground); font: 500 12px/1.5 var(--mono); text-decoration: none; }
.version:hover { color: var(--foreground); border-color: var(--muted-foreground); }
.mark-body { fill: var(--foreground); }
.mark-eye { stroke: var(--sidebar); }
.mark-dot { fill: var(--primary); }
.doc-nav ul, .outline ul, .bottom ul, .menu ul { list-style: none; margin: 0; padding: 0; }
.actions-top { display: flex; align-items: center; gap: 0.5rem; }
.lang { display: inline-flex; padding: 2px; border-radius: 0.5rem; background: var(--sidebar-accent); }
.lang a { padding: 0.1875rem 0.5rem; border-radius: 0.375rem; color: var(--muted-foreground); text-decoration: none; font-size: 13px; font-weight: 500; }
.lang a[aria-current] { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px #00000014; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; height: 2rem; padding: 0 0.875rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--background); color: var(--foreground); text-decoration: none; font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover { color: var(--foreground); background: var(--sidebar-accent); }
.btn-lg { height: 2.5rem; padding: 0 1.125rem; }
.menu { display: none; }
.menu summary { cursor: pointer; list-style: none; padding: 0.375rem 0.625rem; border-radius: 0.5rem; font-weight: 500; font-size: 14px; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--sidebar-accent); }
.menu nav { position: absolute; left: 0.5rem; right: 0.5rem; top: calc(var(--header) - 0.25rem); max-height: calc(100dvh - var(--header)); overflow-y: auto; background: var(--background); border: 1px solid var(--border); border-radius: 0.75rem; padding: 0.5rem; box-shadow: 0 8px 24px #0000001f; }
.menu h2 { margin: 0.75rem 0.75rem 0.25rem; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.menu a { display: block; padding: 0.5rem 0.75rem; border-radius: 0.5rem; color: var(--foreground); text-decoration: none; }
.menu a:hover, .menu a[aria-current] { background: var(--accent); }

/* Sidebar and the white inset page, as in the app's shell. */
.frame { display: grid; grid-template-columns: 16rem minmax(0, 1fr); min-height: calc(100dvh - var(--header)); }
.frame-full { grid-template-columns: minmax(0, 1fr); }
.doc-nav { position: sticky; top: var(--header); align-self: start; max-height: calc(100dvh - var(--header)); overflow-y: auto; padding: 0.75rem 0.5rem 2rem; }
.doc-nav h2 { margin: 1rem 0.5rem 0.25rem; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.doc-nav > ul > li:first-child h2 { margin-top: 0.25rem; }
.doc-nav > ul > li > a { font-weight: 500; }
.doc-nav a { display: block; padding: 0.375rem 0.5rem; border-radius: 0.375rem; color: var(--foreground); text-decoration: none; font-size: 14px; }
.doc-nav a:hover { background: var(--sidebar-accent); }
.doc-nav a[aria-current] { background: var(--sidebar-accent); font-weight: 500; }
.inset { margin: 0 0.5rem 0.5rem 0; min-width: 0; background: var(--background); border-radius: 0.75rem; box-shadow: 0 1px 2px #0000000d, 0 0 0 1px color-mix(in oklab, var(--border) 60%, transparent); }
.frame-full .inset { margin-left: 0.5rem; }
.page { display: grid; grid-template-columns: minmax(0, 46rem) 14rem; justify-content: center; gap: 3rem; padding: 2.5rem 2rem 4rem; }

/* Documents: the app's typeset rhythm. */
.crumbs { display: flex; gap: 0.375rem; margin: 0 0 1rem; font-size: 13px; color: var(--muted-foreground); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--foreground); }
.doc h1 { margin: 0; font-size: 1.875rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; }
.doc .lead { margin: 0.75rem 0 0; font-size: 1.0625rem; color: var(--muted-foreground); }
.doc .body { margin-top: 2rem; padding-top: 0.5rem; border-top: 1px solid var(--border); font-size: 15.5px; line-height: 1.75; }
.doc .body > :first-child { margin-top: 1.25em; }
.doc h2, .doc h3, .doc h4 { font-weight: 600; letter-spacing: -0.01em; }
.doc h2 { margin: 2.25em 0 0; font-size: 1.3125rem; line-height: 1.4; }
.doc h3 { margin: 1.75em 0 0; font-size: 1.0625rem; line-height: 1.45; }
.doc h4 { margin: 1.5em 0 0; font-size: 1rem; }
.anchor { margin-left: 0.375rem; color: var(--muted-foreground); text-decoration: none; font-weight: 400; opacity: 0; }
.doc :is(h2, h3, h4):hover .anchor, .anchor:focus-visible { opacity: 1; }
.doc p { margin: 1em 0 0; }
.doc ul, .doc ol { margin: 1em 0 0; padding-left: 1.375em; }
.doc li { margin-top: 0.375em; }
.doc li > p:first-child { margin-top: 0; }
.doc li::marker { color: var(--muted-foreground); }
.doc blockquote { margin: 1.25em 0 0; padding: 0.25em 0 0.25em 1em; border-left: 3px solid var(--border); color: var(--muted-foreground); }
.doc img { margin: 1.25em 0 0; border-radius: var(--radius); border: 1px solid var(--border); }
.doc figure { margin: 1.5em 0 0; }
.doc figure img { margin: 0; }
.doc figcaption { margin-top: 0.5rem; font-size: 13px; line-height: 1.5; color: var(--muted-foreground); }
.doc hr { margin: 2em 0 0; border: 0; border-top: 1px solid var(--border); }
.table-scroll { overflow-x: auto; margin: 1.25em 0 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.6; }
th, td { text-align: left; vertical-align: top; padding: 0.5625rem 0.875rem; border-bottom: 1px solid var(--border); }
thead th { height: 2.25rem; font-size: 13px; font-weight: 500; color: var(--muted-foreground); background: color-mix(in oklab, var(--muted) 50%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
td code, th code { white-space: nowrap; overflow-wrap: normal; }
.doc-foot { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; font-size: 13px; color: var(--muted-foreground); }
.doc-foot a { color: inherit; }

/* On this page, as the app's document outline. */
.outline { position: sticky; top: calc(var(--header) + 2.5rem); align-self: start; max-height: calc(100dvh - var(--header) - 4rem); overflow-y: auto; font-size: 13px; }
.outline h2 { margin: 0 0 0.5rem; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.outline a { display: block; padding: 0.25rem 0.5rem; border-radius: 0.375rem; color: var(--muted-foreground); text-decoration: none; line-height: 1.45; }
.outline a:hover { color: var(--foreground); background: var(--accent); }
.outline a[aria-current] { color: var(--foreground); background: var(--accent); font-weight: 500; }
.outline .d3 a { padding-left: 1.25rem; }

/* The overview's hero, and the not-found page. */
.hero { max-width: 64rem; margin: 0 auto; padding: 3.5rem 2rem 0; }
.hero h1, .home h1 { margin: 0; font-size: clamp(2rem, 4.4vw, 3.25rem); line-height: 1.1; font-weight: 600; letter-spacing: -0.035em; max-width: 22ch; }
.hero .lead, .home .lead { margin: 1rem 0 0; max-width: 46rem; font-size: 1.125rem; color: var(--muted-foreground); }
.hero .shot { width: 100%; height: auto; margin-top: 2.5rem; border-radius: 0.875rem; border: 1px solid var(--border); box-shadow: 0 24px 48px -24px #1e1b4b40; }
.home { padding: 4rem 2rem 5rem; }
.home section { max-width: 64rem; margin: 0 auto; }
.eyebrow { margin: 0 0 0.75rem; font-size: 13px; font-weight: 500; color: var(--primary); }
.news { display: inline-flex; align-items: center; gap: 0.5rem; max-width: 100%; margin: 0 0 1.25rem; padding: 0.25rem 0.75rem 0.25rem 0.25rem; border-radius: 999px; border: 1px solid var(--border); background: var(--background); color: var(--foreground); font-size: 13px; text-decoration: none; }
.news span { flex: none; padding: 0.125rem 0.5rem; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); font-weight: 500; }
.news:hover { border-color: var(--primary); }
.news::after { content: "→"; color: var(--muted-foreground); }

/* Release notes: one section per release. */
.release + .release { margin-top: 3.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.doc .release h2 span { color: var(--muted-foreground); font-weight: 500; }
.release-meta { margin: 0.25rem 0 0; font: 12px/1.6 var(--mono); color: var(--muted-foreground); }
.release > .lead { margin-top: 0.75rem; }
.cta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.75rem; }
.doc-home .body { margin-top: 0; padding-top: 0; border-top: 0; }

/* Diagrams written in the docs as HTML, so they follow the theme and the page's language. */
.doc :is(.rail, .planes, .tiles) { margin: 1.5em 0 0; padding: 0; list-style: none; line-height: 1.45; }
.doc :is(.rail, .planes, .tiles) li { margin: 0; }
/* Track's stages in order: a dot per stage on one line, the evidence below. */
.rail { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.rail li { position: relative; padding: 1.5rem 0.375rem 0 0; font-size: 13px; color: var(--muted-foreground); }
.rail li::before { content: ""; position: absolute; top: 0.3125rem; left: 0; right: 0; height: 2px; background: color-mix(in oklab, var(--primary) 35%, var(--border)); }
.rail li:last-child::before { right: 50%; }
.rail li::after { content: ""; position: absolute; top: 0; left: 0; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--background); }
.rail b { display: block; margin-bottom: 0.25rem; font-size: 13.5px; font-weight: 600; color: var(--foreground); }
.rail span { display: block; }
/* Layers from the people and agents who work down to the record that joins it all. */
.planes { display: grid; gap: 0.5rem; }
.planes > li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.75rem; align-items: center; }
.planes > li > b { font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.planes ul { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0; padding: 0; list-style: none; }
.planes ul li { flex: 1 1 7rem; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--background); font-size: 13.5px; text-align: center; }
.planes ul li small { display: block; font-size: 12px; color: var(--muted-foreground); }
.planes .bar li { background: color-mix(in oklab, var(--primary) 8%, var(--background)); border-color: color-mix(in oklab, var(--primary) 30%, var(--border)); }
.planes .main li { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); font-weight: 500; }
.planes .main li small { color: color-mix(in oklab, var(--primary-foreground) 80%, transparent); }
/* Cards linking onward. */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.tiles a { display: block; height: 100%; padding: 0.875rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--foreground); text-decoration: none; font-size: 14px; line-height: 1.5; }
.tiles a:hover { border-color: color-mix(in oklab, var(--primary) 45%, var(--border)); background: color-mix(in oklab, var(--primary) 4%, var(--background)); }
.tiles b { display: block; margin-bottom: 0.25rem; font-weight: 600; }
.tiles span { color: var(--muted-foreground); }

.bottom { padding: 2.5rem 2rem 1.5rem; font-size: 13px; color: var(--muted-foreground); }
.footer-grid { max-width: 64rem; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.bottom h2 { margin: 0 0 0.625rem; font-size: 13px; font-weight: 500; color: var(--foreground); }
.bottom li + li { margin-top: 0.375rem; }
.bottom a { color: var(--muted-foreground); text-decoration: none; }
.bottom a:hover { color: var(--foreground); }
.bottom p { margin: 0.625rem 0 0; }
.legal { max-width: 64rem; margin: 2rem auto 0; padding-top: 1rem; border-top: 1px solid var(--border); }

@media (max-width: 1200px) {
  .page { grid-template-columns: minmax(0, 46rem); }
  .outline { display: none; }
}
@media (max-width: 900px) {
  .actions-top .hide-sm { display: none; }
  .menu { display: block; }
  .frame { grid-template-columns: minmax(0, 1fr); }
  .doc-nav { display: none; }
  .inset { margin: 0 0.5rem 0.5rem; }
  .rail { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 1.25rem; }
  .rail li:nth-child(4)::before { right: 50%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .page { padding: 1.5rem 1rem 3rem; }
  .home { padding: 2.5rem 1rem 3rem; }
  .hero { padding: 2rem 1rem 0; }
  .doc h1 { font-size: 1.5rem; }
  .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail li:nth-child(2n)::before { right: 50%; }
  .planes > li { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .bottom { padding: 2rem 1rem 1.5rem; }
}
