/*
Purpose: shared visual system for the Mullusi documentation package.
Governance scope: static docs layout, typography, navigation, tables, and responsive behavior.
Dependencies: browser CSS support only.
Invariants: readable on mobile and desktop, no build step, no external asset dependency.
*/
:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #5b6863;
  --line: #d9e3de;
  --panel: #f6f8f7;
  --surface: #ffffff;
  --accent: #0b766e;
  --accent-dark: #064f4a;
  --gold: #b4812d;
  --max: 1120px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a {
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent-dark);
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 10vw, 112px) clamp(18px, 4vw, 48px) 48px;
}

.eyebrow,
.card-kicker {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.12;
  margin: 0;
}

h1 {
  max-width: 850px;
  font-size: clamp(2.4rem, 7vw, 5rem);
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  margin-bottom: 18px;
}

h3 {
  font-size: 1.24rem;
  margin-top: 8px;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  margin-top: 22px;
}

.search-panel {
  max-width: 760px;
  margin-top: 28px;
}

.search-panel-wide {
  margin-top: 22px;
}

.search-panel label {
  display: block;
  margin-bottom: 8px;
  font-weight: 750;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-input,
.search-button {
  min-height: 46px;
  border-radius: 8px;
  font: inherit;
}

.search-input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 14px;
  color: var(--ink);
}

.search-input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(11, 118, 110, 0.14);
}

.search-button {
  border: 0;
  padding: 0 18px;
  color: white;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.search-button:hover {
  background: var(--accent-dark);
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 38px clamp(18px, 4vw, 48px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  min-height: 186px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  background: var(--surface);
}

.card:hover {
  border-color: var(--accent);
}

.search-results {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.result-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  background: var(--surface);
}

.result-card:hover {
  border-color: var(--accent);
}

.result-card h2 {
  font-size: 1.22rem;
  margin: 8px 0;
}

.empty-state {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
}

.card p,
.section p,
.doc p,
.doc li {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: start;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

th {
  background: var(--panel);
  font-size: 0.9rem;
}

tr:last-child td {
  border-bottom: 0;
}

.site-footer {
  max-width: var(--max);
  margin: 54px auto 0;
  padding: 24px clamp(18px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.doc-layout {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 40px;
  padding: 42px clamp(18px, 4vw, 48px) 64px;
}

.toc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 90px;
  align-self: start;
  color: var(--muted);
  font-size: 0.94rem;
}

.toc a {
  text-decoration: none;
}

.doc {
  min-width: 0;
}

.doc h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}

.doc p,
.doc li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.doc h2 {
  font-size: 1.75rem;
  margin-top: 42px;
}

pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #101715;
  color: #e8f2ee;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.94em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
}

.state-pass {
  color: #064f4a;
  background: rgba(11, 118, 110, 0.12);
}

.state-pending {
  color: #7a4e00;
  background: rgba(180, 129, 45, 0.16);
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    padding-top: 42px;
  }

  .split,
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .doc-layout {
    max-width: 100vw;
    overflow-x: hidden;
    padding-inline: 20px;
  }

  .doc {
    width: 100%;
    max-width: min(100%, 320px);
    overflow-x: hidden;
  }

  .doc h1 {
    max-width: min(100%, 320px);
    font-size: 1.78rem;
  }

  .toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  tr:last-child {
    border-bottom: 0;
  }

  th,
  td {
    border-bottom: 0;
    padding: 6px 12px;
  }
}
