/* Askling docs site. Every colour, font and radius is a token of packages/ui/src/tokens.css (copied next to this file
   at build time). Light only, like the app. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Anybody";
  src: url("/assets/fonts/anybody-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: swap;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--surface-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--surface-card); border-radius: var(--radius-tag); }
.skip:focus { top: 12px; }
.icon { flex: none; }

/* ---- top bar: the app's navy band ------------------------------------------------ */
.topbar { position: sticky; top: 0; z-index: var(--z-topbar); background: var(--band-surface); color: var(--text-on-band); }
.topbar__in { display: flex; align-items: center; gap: 20px; max-width: 1440px; height: 64px; margin: 0 auto; padding: 0 24px; }
.topbar__grow { flex: 1; }
.topbar :focus-visible { outline-color: var(--focus-ring-on-band); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brandmark { width: 30px; height: 22px; flex: none; }
.bm-strip { fill: var(--yes-solid); }
.bm-fold { fill: var(--yes-fold); }
.bm-card { fill: var(--text-on-band); }
.bm-tag { fill: var(--brand-solid); }
.bm-nudge { fill: var(--yes-solid); }
.brand__name { font-family: var(--font-display); font-size: 1.25rem; font-weight: var(--weight-display); font-stretch: var(--stretch-display); letter-spacing: -0.01em; }
.brand__docs { padding: 2px 10px; border-radius: var(--radius-pill); background: var(--band-raised-2); color: var(--text-on-band-secondary); font-size: var(--text-sm); font-weight: var(--weight-strong); }
.topbar__links { display: flex; align-items: center; gap: 18px; margin-left: auto; flex: none; }
.toplink { color: var(--text-on-band-secondary); text-decoration: none; font-size: var(--text-md); font-weight: 500; }
.toplink:hover { color: var(--text-on-band); }
.btn-yes,
.btn-navy {
  display: inline-flex; align-items: center; gap: 6px; height: var(--control-h); padding: 0 16px; border-radius: var(--radius-tile);
  font-family: var(--font-display); font-weight: var(--weight-tag); font-stretch: var(--stretch-tag); font-size: 0.9375rem; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-ui);
}
.btn-yes { background: var(--yes-solid); color: var(--text-on-yes); }
.btn-yes:hover { background: var(--yes-bright); }
.btn-navy { background: var(--brand-face); color: var(--yes-solid); }
.btn-navy:hover { background: var(--brand-hover); }
.menu-btn {
  display: none; align-items: center; justify-content: center; width: var(--touch-min); height: var(--touch-min); margin-left: -10px;
  border: 0; border-radius: var(--radius-tag); background: transparent; color: var(--text-on-band); cursor: pointer;
}
.menu-btn:hover { background: var(--band-raised); }

/* ---- search ----------------------------------------------------------------------- */
.search { position: relative; flex: 1; min-width: 0; max-width: 520px; }
.search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-on-band-secondary); pointer-events: none; }
.search input {
  width: 100%; height: var(--control-h); padding: 0 44px 0 40px; border: 1px solid var(--line-on-band); border-radius: var(--radius-input);
  background: var(--band-raised); color: var(--text-on-band); font: inherit; font-size: 0.9375rem;
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--text-on-band-secondary); }
.search input:focus { outline: none; border-color: var(--line-on-band-strong); background: var(--band-raised-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search__key {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); min-width: 22px; padding: 1px 6px; border: 1px solid var(--line-on-band-strong);
  border-radius: 6px; color: var(--text-on-band-secondary); font-family: var(--font-mono); font-size: var(--text-xs); text-align: center; pointer-events: none;
}
.search--big { max-width: 680px; margin: 0 auto; }
.search--big .search__icon { left: 20px; color: var(--text-secondary); }
.search--big input {
  height: 60px; padding: 0 56px 0 56px; border: 1px solid var(--line-subtle); border-radius: var(--radius-tile); background: var(--surface-card);
  color: var(--text-primary); font-size: 1.0625rem; box-shadow: var(--shadow-float);
}
.search--big input::placeholder { color: var(--text-secondary); }
.search--big input:focus { background: var(--surface-card); border-color: var(--line-strong); }
.search--big .search__key { right: 18px; border-color: var(--line-strong); color: var(--text-secondary); }
.search__results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: var(--z-popover); max-height: min(70vh, 520px); overflow: auto;
  margin: 0; padding: 6px; list-style: none; text-align: left; background: var(--surface-card); color: var(--text-primary);
  border: 1px solid var(--line-subtle); border-radius: var(--radius-tile); box-shadow: var(--shadow-popup);
}
.search__results[hidden] { display: none; }
.search__results a { display: block; padding: 10px 12px; border-radius: var(--radius-tag); text-decoration: none; }
.search__results [aria-selected="true"] a,
.search__results a:hover { background: var(--surface-hover); }
.search__results .r-title { display: block; font-weight: var(--weight-strong); line-height: 1.35; }
.search__results .r-cat { display: block; margin-top: 2px; color: var(--text-secondary); font-size: var(--text-sm); }
.search__results .r-none { padding: 12px; color: var(--text-secondary); }

/* ---- home ------------------------------------------------------------------------- */
.hero { background: var(--band-surface); color: var(--text-on-band); }
.hero__in { max-width: 960px; margin: 0 auto; padding: 72px 24px 88px; text-align: center; }
.hero__title {
  margin: 0 0 32px; font-family: var(--font-display); font-weight: var(--weight-display); font-stretch: var(--stretch-display);
  font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: var(--leading-tight); letter-spacing: -0.02em;
}
.start { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 12px; margin-top: 28px; }
.start__label { color: var(--text-on-band-secondary); font-size: var(--text-md); }
.start ul { display: contents; list-style: none; }
.chip {
  display: inline-block; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--band-raised); color: var(--text-on-band);
  font-size: var(--text-md); text-decoration: none; border: 1px solid var(--line-on-band);
}
.chip:hover { background: var(--band-raised-2); border-color: var(--line-on-band-strong); }
.home { max-width: 1200px; margin: 0 auto; padding: 64px 24px 96px; }
.home__title { margin: 0 0 24px; font-family: var(--font-display); font-weight: var(--weight-display); font-stretch: var(--stretch-display); font-size: 1.5rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--grid-gap); margin: 0; padding: 0; list-style: none; }
.card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; height: 100%;
  padding: 22px; border: 1px solid var(--line-subtle); border-radius: var(--radius-tile); background: var(--tile-face); text-decoration: none;
  transition: box-shadow var(--dur-base) var(--ease-enter), transform var(--dur-base) var(--ease-enter), border-color var(--dur-base) var(--ease-enter);
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--line-strong); }
.card__icon {
  grid-row: span 2; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border-radius: var(--radius-chip); background: var(--chip-surface); color: var(--yes-solid);
}
.card__name { font-family: var(--font-display); font-weight: var(--weight-tag); font-stretch: var(--stretch-tag); font-size: 1.125rem; line-height: 1.25; }
.card__count { color: var(--text-secondary); font-size: var(--text-md); }

/* ---- docs layout: sidebar, article, on this page --------------------------------- */
.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 240px; max-width: 1440px; margin: 0 auto; }
.layout--two { grid-template-columns: 280px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); overflow-y: auto; padding: 28px 16px 48px 24px;
  border-right: 1px solid var(--line-subtle); background: var(--surface-card);
}
.side__all { display: inline-block; margin: 0 0 12px 10px; color: var(--text-secondary); font-size: var(--text-sm); font-weight: var(--weight-strong); text-decoration: none; }
.side__all:hover { color: var(--text-primary); }
.side__cats,
.side__list { margin: 0; padding: 0; list-style: none; }
.side__catlink {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-tag); text-decoration: none;
  font-weight: 500; font-size: 0.9375rem; color: var(--text-strong);
}
.side__catlink .icon { color: var(--text-secondary); }
.side__catlink:hover { background: var(--surface-hover); }
.side__catlink[aria-current="page"],
.side__cat.is-open > .side__catlink { color: var(--text-primary); font-weight: var(--weight-strong); }
.side__catlink[aria-current="page"] { background: var(--surface-hover); }
.side__count { margin-left: auto; color: var(--text-secondary); font-size: var(--text-xs); font-weight: 500; }
.side__list { margin: 2px 0 10px 19px; padding-left: 10px; border-left: 1px solid var(--line-subtle); }
.side__list a { display: block; padding: 5px 10px; border-radius: var(--radius-tag); color: var(--text-secondary); font-size: var(--text-md); line-height: 1.4; text-decoration: none; }
.side__list a:hover { background: var(--surface-hover); color: var(--text-primary); }
.side__list a[aria-current="page"] { background: var(--brand-solid); color: var(--text-on-solid); font-weight: var(--weight-strong); }
.scrim { display: none; }

.doc { min-width: 0; padding: 32px 56px 96px; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 24px; padding: 0; list-style: none; font-size: var(--text-sm); color: var(--text-secondary); }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text-primary); text-decoration: underline; }

.cat-head { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.cat-head h1 { margin: 0; font-family: var(--font-display); font-weight: var(--weight-display); font-stretch: var(--stretch-display); font-size: 2.25rem; line-height: var(--leading-tight); }
.cat-head__count { margin: 4px 0 0; color: var(--text-secondary); }
.cat-head .card__icon { grid-row: auto; width: 56px; height: 56px; }
.cat-list { max-width: 820px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-subtle); }
.cat-list a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line-subtle); text-decoration: none; font-weight: 500; }
.cat-list a .icon { color: var(--text-secondary); transition: transform var(--dur-fast) var(--ease-ui); }
.cat-list a:hover { color: var(--text-strong); }
.cat-list a:hover .icon { transform: translateX(3px); color: var(--text-primary); }

/* ---- the article ------------------------------------------------------------------ */
.prose { max-width: 70ch; font-size: 1.0625rem; line-height: 1.65; color: var(--text-strong); }
.prose h1 {
  margin: 0 0 12px; color: var(--text-primary); font-family: var(--font-display); font-weight: var(--weight-display); font-stretch: var(--stretch-display);
  font-size: clamp(1.875rem, 3.2vw, 2.5rem); line-height: var(--leading-tight); letter-spacing: -0.015em;
}
.meta { margin: 0 0 32px; }
.meta time { display: inline-block; padding: 3px 12px; border-radius: var(--radius-pill); background: var(--pill-surface); color: var(--text-secondary); font-size: var(--text-sm); }
.prose h2 {
  margin: 56px 0 16px; padding-top: 24px; border-top: 1px solid var(--line-subtle); color: var(--text-primary);
  font-family: var(--font-display); font-weight: var(--weight-display); font-stretch: var(--stretch-display); font-size: 1.5rem; line-height: 1.25;
}
.prose h3 { margin: 36px 0 10px; color: var(--text-primary); font-family: var(--font-display); font-weight: var(--weight-tag); font-size: 1.1875rem; line-height: 1.3; }
.prose h4 { margin: 28px 0 8px; color: var(--text-primary); font-size: 1.0625rem; }
.prose p { margin: 0 0 16px; }
.prose strong { color: var(--text-primary); font-weight: var(--weight-strong); }
.prose a { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-color: var(--yes-strip); text-decoration-thickness: 2px; }
.prose ul,
.prose ol { margin: 0 0 20px; padding-left: 1.4em; }
.prose li { margin: 6px 0; padding-left: 4px; }
.prose li > ul,
.prose li > ol { margin: 6px 0 4px; }
.prose ol > li::marker { font-weight: var(--weight-strong); color: var(--text-primary); }
.prose ul > li::marker { color: var(--text-secondary); }
.prose code { padding: 1px 6px; border-radius: 6px; background: var(--surface-well); border: 1px solid var(--line-subtle); font-family: var(--font-mono); font-size: 0.875em; word-break: break-word; }
.prose pre { margin: 0 0 20px; padding: 16px 18px; overflow-x: auto; border-radius: var(--radius-tile); background: var(--surface-well); border: 1px solid var(--line-subtle); }
.prose pre code { padding: 0; border: 0; background: none; font-size: 0.875rem; }
.prose blockquote { margin: 0 0 20px; padding: 12px 18px; border-left: 3px solid var(--yes-solid); background: var(--yes-tint); border-radius: 0 var(--radius-tag) var(--radius-tag) 0; }
.prose .table { margin: 8px 0 24px; overflow-x: auto; border: 1px solid var(--line-subtle); border-radius: var(--radius-tile); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
.prose th { padding: 10px 14px; background: var(--surface-well); color: var(--text-primary); font-size: var(--text-sm); font-weight: var(--weight-strong); text-align: left; white-space: nowrap; }
.prose td { padding: 10px 14px; border-top: 1px solid var(--line-subtle); vertical-align: top; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--grid-gap); max-width: 70ch; margin-top: 64px; }
.pager__link { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line-subtle); border-radius: var(--radius-tile); text-decoration: none; transition: border-color var(--dur-fast) var(--ease-ui), box-shadow var(--dur-fast) var(--ease-ui); }
.pager__link:hover { border-color: var(--line-strong); box-shadow: var(--shadow-hover); }
.pager__link--next { grid-column: 2; text-align: right; align-items: flex-end; }
.pager__dir { display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary); font-size: var(--text-sm); }
.pager__title { font-weight: var(--weight-strong); line-height: 1.35; }

.toc { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; padding: 36px 24px 48px 8px; }
.toc__title { margin: 0 0 10px; color: var(--text-primary); font-size: var(--text-sm); font-weight: var(--weight-strong); }
.toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line-subtle); }
.toc a { display: block; margin-left: -1px; padding: 4px 12px; border-left: 2px solid transparent; color: var(--text-secondary); font-size: var(--text-md); line-height: 1.4; text-decoration: none; }
.toc .toc__l3 a { padding-left: 24px; }
.toc a:hover { color: var(--text-primary); }
.toc a[aria-current="true"] { border-left-color: var(--yes-solid); color: var(--text-primary); font-weight: 500; }

/* ---- 404 and footer --------------------------------------------------------------- */
.notfound { max-width: 720px; margin: 0 auto; padding: 96px 24px 120px; text-align: center; }
.notfound h1 { margin: 0 0 12px; font-family: var(--font-display); font-weight: var(--weight-display); font-stretch: var(--stretch-display); font-size: 2.5rem; }
.notfound > p { margin: 0 0 32px; color: var(--text-secondary); }
.notfound .search { margin-bottom: 32px; }
.footer { border-top: 1px solid var(--line-subtle); background: var(--surface-well); }
.footer__in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; max-width: 1440px; margin: 0 auto; padding: 28px 24px; color: var(--text-secondary); font-size: var(--text-md); }
.footer p { margin: 0; }
.footer a { color: var(--text-primary); }
.footer nav { display: flex; gap: 20px; margin-left: auto; }
.brand--quiet .brand__name { font-size: 1.0625rem; color: var(--text-primary); }
.brand--quiet .bm-card { fill: var(--surface-sunken); }
.brand--quiet .brand__docs { background: var(--surface-sunken); color: var(--text-secondary); }

/* ---- narrower screens ------------------------------------------------------------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
  .toc { display: none; }
  .doc { padding: 32px 40px 88px; }
}
@media (max-width: 900px) {
  .layout,
  .layout--two { display: block; }
  .menu-btn { display: inline-flex; }
  .sidebar {
    position: fixed; top: 64px; left: 0; bottom: 0; z-index: var(--z-flyout); width: min(320px, 86vw); height: auto; align-self: stretch;
    transform: translateX(-100%); transition: transform var(--dur-base) var(--ease-enter); box-shadow: var(--shadow-popup); visibility: hidden;
  }
  .menu-open .sidebar { transform: none; visibility: visible; }
  .menu-open .scrim { display: block; position: fixed; inset: 64px 0 0; z-index: calc(var(--z-flyout) - 1); background: var(--surface-scrim); }
  .menu-open { overflow: hidden; }
  .doc { padding: 24px 20px 72px; }
  .topbar__in { gap: 12px; padding: 0 16px; }
  .toplink { display: none; }
}
@media (max-width: 640px) {
  .brand__docs { display: none; }
  .topbar .search input { padding-right: 12px; }
  .topbar .search__key { display: none; }
  .btn-yes { padding: 0 12px; font-size: var(--text-md); }
  .btn-yes .icon { display: none; }
  .hero__in { padding: 48px 16px 64px; }
  .search--big input { height: 54px; }
  .search--big .search__key { display: none; }
  .home { padding: 40px 16px 72px; }
  .prose { font-size: 1rem; }
  .pager { grid-template-columns: 1fr; }
  .pager__link--next { grid-column: 1; }
  .cat-head h1 { font-size: 1.75rem; }
  .footer nav { margin-left: 0; }
}
@media (max-width: 480px) {
  .page-home .topbar__links { margin-left: auto; }
  body:not(.page-home):not(.page-404) .topbar__links { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { transition-duration: var(--dur-reduced-fade) !important; animation: none !important; }
  .card:hover { transform: none; }
}

@media print {
  .topbar, .sidebar, .toc, .pager, .footer, .skip { display: none !important; }
  .layout { display: block; }
  .doc { padding: 0; }
}
