/* libkeri site theme, layered over mdBook's own CSS (book.toml additional-css).
   Deep teal surfaces, a turquoise accent and pale green panels; regular-weight
   sentence-case headings; a monospace brand. Light is the "light" theme, dark
   is "navy". mdBook sets the root font size to 62.5%, so 1rem is 10px here. */

:root {
  --lk-teal-deep: #003336;
  --lk-teal: #28999c;
  --lk-turquoise: #51dac5;
  --lk-green-deep: #027361;
  --lk-spring: #dffbc0;
  --lk-spring-soft: #f3fbec;
  --lk-smoke: #6a7b7f;
  --lk-honey: #ffa300;
  --lk-lavender: #7764b1;

  --lk-sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --lk-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --content-max-width: 860px;
  --mono-font: var(--lk-mono);
}

.light, html:not(.js) {
  --bg: #ffffff;
  --fg: #0b1f21;
  --lk-heading: var(--lk-teal-deep);
  --lk-muted: var(--lk-smoke);
  --lk-card-bg: #ffffff;
  --lk-card-border: #d9e7e3;
  --lk-panel: var(--lk-spring-soft);

  --sidebar-bg: var(--lk-spring-soft);
  --sidebar-fg: var(--lk-teal-deep);
  --sidebar-non-existant: #9fb3b0;
  --sidebar-active: var(--lk-green-deep);
  --sidebar-spacer: #e3f1d8;
  --sidebar-header-border-color: var(--lk-turquoise);

  --icons: #4c6467;
  --icons-hover: var(--lk-teal-deep);
  --links: var(--lk-green-deep);
  --inline-code-color: var(--lk-green-deep);

  --theme-popup-bg: #ffffff;
  --theme-popup-border: #d9e7e3;
  --theme-hover: var(--lk-spring-soft);

  --quote-bg: var(--lk-spring-soft);
  --quote-border: var(--lk-spring);

  --table-border-color: #e3ece9;
  --table-header-bg: var(--lk-spring);
  --table-alternate-bg: #fafdf7;

  --searchbar-border-color: #c6d8d4;
  --searchbar-bg: #ffffff;
  --searchbar-fg: #0b1f21;
  --searchbar-shadow-color: #c6d8d4;
  --searchresults-header-fg: var(--lk-smoke);
  --searchresults-border-color: #c6d8d4;
  --searchresults-li-bg: var(--lk-spring-soft);
  --search-mark-bg: var(--lk-turquoise);
}

.navy {
  --bg: #001f21;
  --fg: #d5e5e2;
  --lk-heading: #e8f5f2;
  --lk-muted: #8fa9a6;
  --lk-card-bg: #00282b;
  --lk-card-border: #0b4044;
  --lk-panel: #00282b;

  --sidebar-bg: #00282b;
  --sidebar-fg: #cfe3e0;
  --sidebar-non-existant: #557a77;
  --sidebar-active: var(--lk-turquoise);
  --sidebar-spacer: #0b4044;
  --sidebar-header-border-color: var(--lk-turquoise);

  --icons: #8fa9a6;
  --icons-hover: #ffffff;
  --links: var(--lk-turquoise);
  --inline-code-color: #9be8db;

  --theme-popup-bg: #00282b;
  --theme-popup-border: #0b4044;
  --theme-hover: #003336;

  --quote-bg: #00282b;
  --quote-border: var(--lk-green-deep);

  --table-border-color: #0b4044;
  --table-header-bg: var(--lk-teal-deep);
  --table-alternate-bg: #00262a;

  --searchbar-border-color: #0b4044;
  --searchbar-bg: #00282b;
  --searchbar-fg: #d5e5e2;
  --searchbar-shadow-color: #000;
  --searchresults-header-fg: #8fa9a6;
  --searchresults-border-color: #0b4044;
  --searchresults-li-bg: #003336;
  --search-mark-bg: var(--lk-green-deep);
}

/* ---------- Type ---------- */

html, body { font-family: var(--lk-sans); }
.content { line-height: 1.5; }
.content h1, .content h2, .content h3, .content h4 {
  font-weight: 400;
  line-height: 1.15;
  color: var(--lk-heading);
  letter-spacing: -0.01em;
}
.content h1 { font-size: 3.84rem; margin-top: 0.6em; }
.content h2 { font-size: 2.72rem; margin-top: 1.8em; }
.content h3 { font-size: 2rem; }
.content strong { font-weight: 600; }
.content a { text-underline-offset: 0.15em; }
.content a:hover { color: var(--lk-heading); }

/* ---------- Menu bar: a deep teal band in both themes ---------- */

#mdbook-menu-bar,
#mdbook-menu-bar.bordered {
  background: var(--lk-teal-deep);
  border-block-end-color: transparent;
}
#mdbook-menu-bar .icon-button,
#mdbook-menu-bar .icon-button:visited { color: #b9d4d0; }
#mdbook-menu-bar .icon-button:hover { color: #ffffff; }
.menu-title {
  font-family: var(--lk-mono);
  font-weight: 500;
  font-size: 1.84rem;
  letter-spacing: 0.01em;
  color: #ffffff;
}
.menu-title::after { content: " · KERI in Rust"; color: var(--lk-turquoise); font-family: var(--lk-sans); font-weight: 400; }

/* ---------- Sidebar ---------- */

.sidebar .sidebar-scrollbox { padding-top: 18px; }
.chapter li a, .chapter-item a { border-radius: 6px; }
.chapter li.chapter-item { line-height: 1.6; }

/* ---------- Tables, code, quotes ---------- */

.content table { border-collapse: collapse; font-size: 0.95em; }
.content table thead th { color: var(--lk-heading); font-weight: 600; text-align: left; }
.content table td, .content table th { padding: 0.55em 0.8em; }
.content table td:first-child { white-space: nowrap; }
.content code { font-size: 0.88em; }
.content pre { border-radius: 10px; }
.content blockquote { border-radius: 8px; }

/* ---------- Status chips ---------- */

.chip {
  display: inline-block;
  font-family: var(--lk-mono);
  font-size: 1.152rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18em 0.6em;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: 0.1em;
}
.chip-working { background: var(--lk-spring); color: var(--lk-green-deep); }
.chip-placeholder { background: transparent; color: var(--lk-muted); box-shadow: inset 0 0 0 1px var(--lk-card-border); }
.navy .chip-working { background: var(--lk-green-deep); color: #e8fff8; }

/* ---------- Landing page ---------- */

.lk-hero {
  background: var(--lk-teal-deep);
  color: #e6f3f1;
  border-radius: 18px;
  padding: 4.16rem 3.84rem 3.52rem;
  margin: 1.92rem 0 3.84rem;
  position: relative;
  overflow: hidden;
}
.lk-hero::after {
  /* a faint ring motif, echoing a key event log */
  content: "";
  position: absolute;
  right: -90px; top: -90px;
  width: 300px; height: 300px;
  border-radius: 50%;
  border: 36px solid var(--lk-turquoise);
  opacity: 0.14;
}
.lk-hero .lk-eyebrow {
  font-family: var(--lk-mono);
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lk-turquoise);
}
.content .lk-hero h1 {
  color: #ffffff;
  font-size: 4.16rem;
  margin: 0.35em 0 0.4em;
  max-width: 18ch;
}
.lk-hero p { max-width: 60ch; margin: 0.4em 0; color: #cfe3e0; }
.content .lk-hero a { color: var(--lk-turquoise); }
.lk-pills { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.24rem; }
.content .lk-pills a {
  text-decoration: none;
  font-size: 1.408rem;
  padding: 0.45em 0.95em;
  border-radius: 999px;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.content .lk-pills a.primary { background: var(--lk-turquoise); color: var(--lk-teal-deep); box-shadow: none; }
.content .lk-pills a:hover { box-shadow: inset 0 0 0 1px var(--lk-turquoise); }

.lk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.6rem;
  margin: 1.92rem 0 3.2rem;
}
.content a.lk-card, .lk-card {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  text-decoration: none;
  color: var(--fg);
  background: var(--lk-card-bg);
  border: 1px solid var(--lk-card-border);
  border-top: 4px solid var(--accent, var(--lk-turquoise));
  border-radius: 12px;
  padding: 1.6rem 1.76rem 1.76rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.content a.lk-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 51, 54, 0.12); color: var(--fg); }
.lk-card .lk-index { font-family: var(--lk-mono); font-size: 1.152rem; letter-spacing: 0.06em; color: var(--lk-muted); }
.lk-card .lk-title { font-size: 1.76rem; color: var(--lk-heading); }
.lk-card .lk-body { font-size: 1.472rem; color: var(--fg); opacity: 0.85; }
.lk-card .lk-more { margin-top: auto; font-size: 1.36rem; color: var(--links); }

.lk-band {
  background: var(--lk-panel);
  border-radius: 14px;
  padding: 2.08rem 2.24rem;
  margin: 2.4rem 0;
}

.navy .lk-hero {
  background: linear-gradient(135deg, #003c40 0%, #01544a 100%);
  box-shadow: inset 0 0 0 1px #0b5a5a;
}

@media (max-width: 620px) {
  .lk-hero { padding: 2.88rem 2.08rem; }
  .content .lk-hero h1 { font-size: 3.2rem; }
  .menu-title::after { content: ""; }
}
