/* korrex.ai v2 — the "Korrex One Site" system (SITE-V2, docs/product/SITE_V2_SPEC_2026-09-26.md), set to the
   founder's "Korrex One Site — type & style tokens" (2026-09-26). Page-specific layout lives inline in each page
   (captured from the design, rewritten onto these tokens at build); this file holds the shell every page shares —
   tokens, base, the crisp lift, page and prose measures, the nav, buttons, and the states kx.js toggles. */

:root {
  --kx-ink: #000;
  --kx-paper: #fff;
  --kx-ink-60: rgba(0, 0, 0, 0.6);
  --kx-ink-40: rgba(0, 0, 0, 0.4);
  --kx-rule: rgba(0, 0, 0, 0.12);
  --kx-night: #050505;
  --kx-night-2: #0d0d0e;
  --kx-snow: #fff;
  --kx-snow-70: rgba(255, 255, 255, 0.7);
  --kx-snow-40: rgba(255, 255, 255, 0.4);
  --kx-rule-dark: rgba(255, 255, 255, 0.14);
  /* aliases the hand-authored pages (/assessment, 404) use */
  --kx-muted: var(--kx-ink-60);
  --kx-muted-strong: var(--kx-ink-60);
  --kx-meta: var(--kx-ink-40);
  --kx-hairline: var(--kx-rule);
  --kx-allow: #2ecc71;
  --kx-escalate: #f5a623;
  --kx-deny: #ff3b30;
  --kx-held: #8e8e93;
  --kx-recorded: #5ac8fa;
  --kx-gutter: clamp(20px, 4vw, 72px);
  --kx-page: 1280px;
  --kx-prose: 1120px;
  --kx-nav-h: 56px;
  --kx-text: 'Inter', sans-serif;
  --kx-mono: 'IBM Plex Mono', monospace;
}

/* ---- base (the One Site shell's global rules) ---------------------------- */
html,
body {
  margin: 0;
  padding: 0;
  background: var(--kx-paper);
  color: var(--kx-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
html[data-kx-dark],
html[data-kx-dark] body {
  background: var(--kx-night);
  color: var(--kx-paper);
}
body {
  font-family: var(--kx-text);
}
* {
  box-sizing: border-box;
}
a {
  color: var(--kx-ink);
  text-decoration: none;
}
a:hover {
  color: var(--kx-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
p {
  text-wrap: pretty;
}
h1,
h2,
h3 {
  font-kerning: normal;
  font-optical-sizing: auto;
}
/* Crisp lift: a 1px lift in the ground's own colour, inherited, so the nearest ground wins. Light sections
   (and light pages) lift white, dark sections dark; nav, buttons and media never. */
body,
[data-kx-ground='paper'] {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-kx-dark] body,
[data-kx-ground='night'] {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
nav,
nav *,
button,
button *,
[data-kx-btn],
[data-kx-btn] *,
[data-kx-flat],
img,
video,
iframe,
canvas {
  text-shadow: none !important;
}

/* Page and prose measures: 1280px page, 1120px prose sections; the grounds still run edge to edge. */
[data-kx-wrap='page'] {
  max-width: var(--kx-page) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
[data-kx-wrap='prose'] {
  max-width: var(--kx-prose) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
/* Section pad: 96 / 104 on desktop, 64 / 72 at 720px and under. The wrapper gives up its own. */
[data-kx-sec] {
  padding-top: 96px !important;
  padding-bottom: 104px !important;
}
[data-kx-sec] > [data-kx-wrap] {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
@media (max-width: 720px) {
  [data-kx-sec] {
    padding-top: 64px !important;
    padding-bottom: 72px !important;
  }
}
/* Buttons: 1px solid current colour, 12px 20px, small/500 label. */
[data-kx-btn] {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
#kx-main {
  display: block;
  min-height: 100vh;
}
/* Pre-rendered states carry an inline display from the design; `hidden` must still win. */
[hidden] {
  display: none !important;
}

/* ---- nav ------------------------------------------------------------------ */
.kx-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--kx-night);
  color: #fff;
  border-bottom: 1px solid var(--kx-rule-dark);
  font: 600 11px/1 var(--kx-mono);
  letter-spacing: 0.12em;
}
.kx-nav a,
.kx-nav a:hover {
  color: inherit;
}
.kx-nav__row {
  max-width: var(--kx-page);
  margin: 0 auto;
  padding: 0 var(--kx-gutter);
  min-height: var(--kx-nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
}
.kx-nav__brand {
  display: flex;
  align-items: center;
  flex: none;
  margin-right: auto;
}
.kx-nav__brand:hover {
  text-decoration: none;
  opacity: 0.8;
}
.kx-nav__brand img {
  height: 16px;
  width: auto;
  display: block;
  filter: invert(1);
}
.kx-nav__tabs {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 20px;
}
.kx-nav__tabs a {
  display: flex;
  align-items: center;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 -2px 0 transparent;
  transition:
    color 0.2s,
    box-shadow 0.2s;
}
.kx-nav__tabs a:hover {
  text-decoration: none;
  color: #fff;
}
.kx-nav__tabs a[aria-current='page'] {
  color: #fff;
  box-shadow: inset 0 -2px 0 #fff;
}

/* LAB · PAPERS — a native disclosure, so it opens without JavaScript. */
.kx-nav__lab {
  position: relative;
  flex: none;
}
.kx-nav__lab > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  white-space: nowrap;
}
.kx-nav__lab > summary::-webkit-details-marker {
  display: none;
}
.kx-nav__lab > summary::after {
  content: '▾';
  font-size: 10px;
  opacity: 0.8;
}
.kx-nav__lab.is-current > summary,
.kx-nav__lab[open] > summary {
  border-color: #fff;
}
.kx-nav__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 11px);
  min-width: 240px;
  background: var(--kx-night);
  border: 1px solid var(--kx-rule-dark);
  display: flex;
  flex-direction: column;
}
.kx-nav__menu a {
  padding: 13px 16px;
  font: 500 12px/1.2 var(--kx-text);
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.kx-nav__menu a:first-child {
  border-top: 0;
}
.kx-nav__menu a:hover,
.kx-nav__menu a[aria-current='page'] {
  text-decoration: none;
  color: #fff;
  background: #111;
}
.kx-nav__cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border: 1px solid currentColor;
  font: 500 13px/20px var(--kx-text);
  letter-spacing: normal;
  background: #fff;
  color: #000 !important;
}
.kx-nav__cta:hover {
  text-decoration: none;
  background: #e6e6e6;
}

/* Mobile: one disclosure holds every page. */
.kx-nav__mob {
  display: none;
}
.kx-nav__mob > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.kx-nav__mob > summary::-webkit-details-marker {
  display: none;
}
.kx-nav__glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 16px;
}
.kx-nav__glyph::before {
  content: '≡';
}
.kx-nav__mob[open] .kx-nav__glyph::before {
  content: '×';
}
.kx-nav__sheet {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--kx-night);
  border-top: 1px solid var(--kx-rule-dark);
  max-height: calc(100svh - var(--kx-nav-h));
  overflow-y: auto;
}
.kx-nav__sheet a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 52px;
  padding: 0 var(--kx-gutter);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font: 500 12px/1 var(--kx-mono);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.72);
}
.kx-nav__sheet a span + span {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.64);
}
.kx-nav__sheet a:hover,
.kx-nav__sheet a[aria-current='page'] {
  text-decoration: none;
  color: #fff;
  background: #111;
}
.kx-nav__sheet a.kx-nav__sheet-cta {
  display: flex;
  min-height: 56px;
  background: #fff;
  color: #000;
  border-bottom: 0;
}
@media (max-width: 1179px) {
  .kx-nav__tabs,
  .kx-nav__lab,
  .kx-nav__cta {
    display: none;
  }
  .kx-nav__mob {
    display: block;
  }
}

/* ---- demo panels in full screen: banner and frame together, the frame filling what is left ---- */
[data-kx-demo-panel]:fullscreen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--kx-night-2);
}
[data-kx-demo-panel]:fullscreen [data-kx-demo-box] {
  flex: 1;
  height: auto !important;
}
[data-kx-demo-panel]:fullscreen iframe {
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
}

/* ---- media ---------------------------------------------------------------- */
video[data-kx-video] {
  background: #000;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
