/* documentation.kairoswater.io: matches the kairoswater.io look (stone neutrals, Geist) with KAIROS blue. */
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --text: #1c1917;
  --muted: #57534e;
  --faint: #78716c;
  --accent: #0248ce;
  --accent-hover: #01379f;
  --accent-soft: #edf2fd;
  --draft-bg: #fdf3e1;
  --draft-text: #8a5600;
  --thumb: #f5f5f4;
  --thumb-text: #78716c;
  --dot: rgba(28, 25, 23, 0.10);
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 8px 24px -16px rgba(28, 25, 23, 0.18);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0a09;
    --surface: #1c1917;
    --surface-2: #151210;
    --border: #292524;
    --border-strong: #44403c;
    --text: #fafaf9;
    --muted: #a8a29e;
    --faint: #8f8883;
    --accent: #7ea9ff;
    --accent-hover: #a9c5ff;
    --accent-soft: rgba(126, 169, 255, 0.10);
    --draft-bg: rgba(232, 160, 40, 0.14);
    --draft-text: #f0b453;
    --thumb: #d9d6d3;
    --thumb-text: #57534e;
    --dot: rgba(250, 250, 249, 0.07);
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0a09;
  --surface: #1c1917;
  --surface-2: #151210;
  --border: #292524;
  --border-strong: #44403c;
  --text: #fafaf9;
  --muted: #a8a29e;
  --faint: #8f8883;
  --accent: #7ea9ff;
  --accent-hover: #a9c5ff;
  --accent-soft: rgba(126, 169, 255, 0.10);
  --draft-bg: rgba(232, 160, 40, 0.14);
  --draft-text: #f0b453;
  --thumb: #d9d6d3;
  --thumb-text: #57534e;
  --dot: rgba(250, 250, 249, 0.07);
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.skip:focus { left: 16px; }
.preview-banner { background: #a86800; color: #fff; text-align: center; padding: 8px 16px; font-size: 14px; font-weight: 500; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand img { display: block; height: 22px; width: auto; }
.brand-label { font-size: 15px; font-weight: 500; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--border-strong); line-height: 22px; white-space: nowrap; }
.bar-links { display: flex; flex: none; align-items: center; gap: 20px; font-size: 14px; }
.bar-links a { color: var(--muted); white-space: nowrap; }
.bar-links a:hover { color: var(--text); text-decoration: none; }
.theme-btn {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer;
}
.theme-btn:hover { color: var(--text); border-color: var(--border-strong); }
.theme-btn .ic-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .ic-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .ic-moon { display: none; }
}
:root[data-theme="dark"] .theme-btn .ic-sun { display: block; }
:root[data-theme="dark"] .theme-btn .ic-moon { display: none; }
@media (max-width: 640px) {
  .bar-links { gap: 12px; }
  .bar-links .hide-sm { display: none; }
  .brand img { height: 18px; }
  .brand-label { font-size: 14px; padding-left: 10px; }
  .brand { gap: 10px; }
}

/* Hero */
.hero {
  padding: 72px 0 44px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: center top;
}
.eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0 auto; max-width: 18ch; font-size: clamp(34px, 6vw, 58px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 600; text-wrap: balance; }
.lede { max-width: 60ch; margin: 18px auto 0; color: var(--muted); font-size: 18px; text-wrap: pretty; }
.tools { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 620px; margin: 32px auto 0; }
.search { position: relative; display: block; width: 100%; }
.search .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input {
  width: 100%; height: 50px; padding: 0 16px 0 46px;
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
  box-shadow: var(--shadow);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.jump a { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; }
.jump a:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
@media (max-width: 640px) {
  .hero { padding: 48px 0 32px; }
  .lede { font-size: 16px; }
}

/* Catalog */
.content { display: flex; flex-direction: column; gap: 80px; padding-top: 56px; padding-bottom: 88px; } /* gap, not margins, so sections hidden by search leave no space */
.cat { scroll-margin-top: 84px; }
.cat-head h2 { margin: 0 0 10px; font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.line + .line { margin-top: 56px; }
.line-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.line-head h3 { margin: 0; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 600; }
.line-head p { margin: 0; color: var(--muted); max-width: 64ch; }
.group { margin-top: 32px; }
.group-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.group-note { margin: 4px 0 0; font-size: 14px; color: var(--faint); max-width: 78ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 14px; }
@media (max-width: 640px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 84px;
}
.card:target { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; min-height: 0; overflow: hidden; background: var(--thumb); border-bottom: 1px solid var(--border); }
/* line art and renders are drawn for a light background, so thumbnails stay light in dark mode too */
.thumb img { position: absolute; inset: 8% 10%; width: 80%; height: 84%; object-fit: contain; }
.thumb-ph { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--thumb-text); }
.card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 18px 18px 16px; }
.card-title { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.card-sub { margin: 0; font-size: 14px; color: var(--muted); }
.card-models { margin: 0; font-size: 13px; color: var(--faint); }
.docs { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doc {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text);
}
a.doc:hover { color: var(--text); text-decoration: none; border-color: var(--accent); background: var(--accent-soft); }
.doc > .ic { flex: none; width: 20px; height: 20px; color: var(--accent); }
.doc-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.doc-title { font-size: 15px; font-weight: 500; line-height: 1.35; }
.doc-meta { font-size: 12.5px; color: var(--faint); line-height: 1.4; }
.doc-go { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--accent); }
a.doc:hover .doc-go { background: var(--surface); }
.doc.is-soon { background: transparent; border-style: dashed; color: var(--muted); }
.doc.is-soon > .ic { color: var(--faint); }
.pill { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 1px; }
.pill-draft { background: var(--draft-bg); color: var(--draft-text); }
.vendor { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 14px; font-size: 14px; align-self: flex-start; }
.vendor .ic { width: 15px; height: 15px; }
.no-results { margin: 0; text-align: center; color: var(--muted); }

/* 404 */
.hero-404 { padding: 112px 0 120px; border-bottom: 0; }
.back { margin: 28px 0 0; }
.button { display: inline-block; padding: 12px 20px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 500; }
.button:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
:root[data-theme="dark"] .button { color: #0c0a09; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .button { color: #0c0a09; } }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; }
.foot p { margin: 0; }
.foot-meta { color: var(--faint); }
