/* biome-ignore-all lint/complexity/noImportantStyles: design nodes carry their values inline; breakpoint and state rules must win over them */
/*
 * Site base. Colors, type and radii come from @kimo/design-tokens (editor.css, copied into the
 * build as /tokens.css and loaded first); nothing here redefines a token. Fonts are the bundled
 * Inter / JetBrains Mono the renderer ships (served from /fonts, never a third party).
 */
@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/Inter-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/Inter-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/Inter-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/Inter-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/Inter-Italic.ttf") format("truetype");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-Medium.ttf") format("truetype");
}

*,
::before,
::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  background: var(--kimo-bg-app);
  color: var(--kimo-text-primary);
  font-family: var(--kimo-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,
h2,
h3,
h4,
p,
pre,
ul,
ol,
figure {
  margin: 0;
}
/* Line breaking: headings balance their lines, running text avoids a lone last word, and names,
   commands and URLs (.nobr, from keepTogether in html.ts) never break inside. */
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}
p,
li,
dd,
blockquote,
figcaption {
  text-wrap: pretty;
}
.nobr {
  white-space: nowrap;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
kbd {
  font: inherit;
}
img {
  max-width: none;
}
summary {
  list-style: none;
  cursor: pointer;
}
summary::-webkit-details-marker {
  display: none;
}
.i {
  display: block;
  flex-shrink: 0;
}
.ic {
  align-items: center;
  justify-content: center;
}
:focus-visible {
  outline: 2px solid var(--kimo-selection) !important;
  outline-offset: 2px !important;
}

/* Interaction states (the design specifies rest states only; these use house tokens). */
.link {
  transition: color 120ms;
}
.link:hover,
.link:hover * {
  color: var(--kimo-text-primary) !important;
}
.btn {
  transition:
    background-color 120ms,
    opacity 120ms;
  text-decoration: none;
}
.btn--accent:hover {
  background: var(--kimo-accent-hover) !important;
}
.btn--outline:hover {
  background: var(--kimo-bg-hover) !important;
}
.btn--ghost:hover {
  opacity: 0.72;
}
.icon-btn:hover {
  background: var(--kimo-bg-hover);
}
.row-link:hover {
  background: var(--kimo-bg-hover);
}
.copy {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--kimo-text-tertiary);
  border-radius: 4px;
}
.copy:hover,
.copy:hover * {
  color: var(--kimo-text-primary) !important;
}
pre {
  font: inherit;
}

/* Agent mark (static idle face; packages/ui AgentMark's CSS read of the shader body). */
.agent-mark {
  position: relative;
  display: inline-block;
  flex: none;
  line-height: 0;
}
.agent-mark__body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mark-base) 35%, var(--mark-second) 75%);
}
.agent-mark__eyes {
  position: absolute;
  inset: 0;
  overflow: visible;
}

/* Mobile drawer (F0F2T): scrim #0A0A0A66, panel 320 with shadow 8/0/32 shadow-strong. */
.drawer[hidden] {
  display: none;
}
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.drawer__scrim {
  position: absolute;
  inset: 0;
  background: #0a0a0a66;
}
.drawer__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  max-width: calc(100vw - 40px);
  overflow: hidden;
}
.drawer .nav-group:hover,
.drawer .nav-item:hover {
  background: var(--kimo-bg-hover);
  border-radius: var(--kimo-radius-md);
}
body.has-overlay {
  overflow: hidden;
}

/* Version menu. */
.version {
  position: relative;
  flex-shrink: 0;
}
.version__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 168px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--kimo-bg-overlay);
  border-radius: var(--kimo-radius-md);
  outline: 1px solid var(--kimo-border);
  box-shadow: var(--kimo-elevation-popover);
}
.drawer .version__menu {
  left: 0;
  right: auto;
}
.version__menu a {
  padding: 7px 10px;
  border-radius: var(--kimo-radius-sm);
  font-size: 13px;
  color: var(--kimo-text-secondary);
  white-space: nowrap;
}
.version__menu a:hover {
  background: var(--kimo-bg-hover);
  color: var(--kimo-text-primary);
}

/* Search dialog (house tokens: overlay, elevation-dialog, radius-lg). */
.search[hidden] {
  display: none;
}
.search {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 16px 16px;
}
.search__scrim {
  position: absolute;
  inset: 0;
  background: #0a0a0a40;
}
.search__panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  background: var(--kimo-bg-overlay);
  border-radius: var(--kimo-radius-lg);
  outline: 1px solid var(--kimo-border);
  outline-offset: -0.5px;
  box-shadow: var(--kimo-elevation-dialog);
  overflow: hidden;
}
.search__field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 52px;
  box-shadow: inset 0 -1px 0 var(--kimo-border);
  color: var(--kimo-text-tertiary);
}
.search__field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0 !important;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--kimo-text-primary);
}
.search__field input::-webkit-search-cancel-button {
  display: none;
}
.search__esc {
  font-family: var(--kimo-font-mono);
  font-size: 11px;
  color: var(--kimo-text-secondary);
  padding: 2px 6px;
  border-radius: 6px;
  outline: 1px solid var(--kimo-border-strong);
  outline-offset: -0.5px;
}
.search__results {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
}
.search__results a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border-radius: var(--kimo-radius-md);
}
.search__results [aria-selected="true"] a,
.search__results a:hover {
  background: var(--kimo-bg-hover);
}
.search__hit-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--kimo-text-primary);
}
.search__hit-path {
  font-size: 12px;
  color: var(--kimo-text-tertiary);
}
.search__hit-snippet {
  font-size: 13px;
  line-height: 1.45;
  color: var(--kimo-text-secondary);
}
.search__results mark {
  background: var(--kimo-selection-soft);
  color: var(--kimo-text-primary);
  border-radius: 2px;
}
.search__empty {
  padding: 20px 18px;
  font-size: 14px;
  color: var(--kimo-text-tertiary);
}
