/* 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, sections centred, actions right. */
.top { position: sticky; top: 0; z-index: 10; height: var(--header); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; 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; }
.brand small { font-weight: 500; color: var(--muted-foreground); font-size: 13px; padding-left: 0.5rem; margin-left: 0.125rem; border-left: 1px solid var(--border); }
.mark { width: 22px; height: 22px; }
.mark-body { fill: var(--foreground); }
.mark-eye { stroke: var(--sidebar); }
.mark-dot { fill: var(--primary); }
.sections ul, .doc-nav ul, .outline ul, .bottom ul, .menu ul { list-style: none; margin: 0; padding: 0; }
.sections ul { display: flex; gap: 0.25rem; }
.sections a { display: block; padding: 0.375rem 0.75rem; border-radius: 0.5rem; color: var(--muted-foreground); text-decoration: none; font-weight: 500; font-size: 14px; }
.sections a:hover { color: var(--foreground); background: var(--sidebar-accent); }
.sections a[aria-current] { color: var(--foreground); background: var(--background); box-shadow: 0 1px 2px #0000000f, 0 0 0 1px var(--border); }
.actions-top { justify-self: end; 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 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 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; }

/* Home. */
.home { padding: 4rem 2rem 5rem; }
.home section { max-width: 64rem; margin: 0 auto; }
.home section + section { margin-top: 4.5rem; }
.eyebrow { margin: 0 0 0.75rem; font-size: 13px; font-weight: 500; color: var(--primary); }
.home h1 { margin: 0; font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.08; font-weight: 600; letter-spacing: -0.035em; max-width: 16ch; }
.home h2 { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.home h3 { margin: 0 0 0.375rem; font-size: 15px; font-weight: 600; }
.home .lead { margin: 1rem 0 0; max-width: 42rem; font-size: 1.125rem; color: var(--muted-foreground); }
.home .section-lead { margin: 0.5rem 0 1.25rem; max-width: 42rem; color: var(--muted-foreground); }
.cta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.75rem; }
.copy { margin: 0.75rem 0 0; max-width: 46rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--background); }
.copy figcaption { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.375rem 0.5rem 0.375rem 0.875rem; font-size: 13px; color: var(--muted-foreground); border-bottom: 1px solid var(--border); background: color-mix(in oklab, var(--muted) 50%, transparent); }
.copy pre { margin: 0; border: 0; border-radius: 0; white-space: pre-wrap; }
.copy-btn { font: 500 12px var(--sans); color: var(--foreground); background: var(--background); border: 1px solid var(--border); border-radius: 0.375rem; padding: 0.1875rem 0.625rem; cursor: pointer; }
.copy-btn[hidden] { display: none; }
.loop { max-width: 34rem; margin-top: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.card { border: 1px solid var(--border); border-radius: 0.875rem; padding: 1.125rem 1.25rem; background: var(--background); }
.card ul { margin: 0; padding-left: 1.125em; color: var(--muted-foreground); }
.card li + li { margin-top: 0.375rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.cards p { margin: 0; color: var(--muted-foreground); font-size: 14px; }
.note { margin: 1rem 0 0; font-size: 13px; 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) {
  .top { grid-template-columns: 1fr auto; }
  .sections, .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; }
  .cards { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .page { padding: 1.5rem 1rem 3rem; }
  .home { padding: 2.5rem 1rem 3rem; }
  .doc h1 { font-size: 1.5rem; }
  .cards, .split { grid-template-columns: 1fr; }
  .bottom { padding: 2rem 1rem 1.5rem; }
}
