/* Gumpian AI by Gumpworks. Licensed under the World Gump Licence v1.0. See LICENSE.md. An Open Gump Foundation project. */
/*
 * Gumpian AI — shared site and example styles.
 *
 * Windows 95 / web 1.5 industrial. Tight margins, hard 1px bevels, zero
 * rounded corners, muted greys, white panels, and a single navy accent.
 * No gradients, no blur, no soft shadows, no rounded anything.
 */

:root {
  --bg: #c0c0c0;
  --bg-2: #d4d0c8;
  --bg-3: #e8e8e8;
  --panel: #ffffff;
  --panel-2: #f4f4f4;
  --line: #808080;
  --line-bright: #404040;
  --ink: #1a1a1a;
  --ink-dim: #4a4a4a;
  --ink-faint: #6a6a6a;
  --accent: #1f4e79;
  --accent-dim: #7f9db9;
  --green: #2f6b3a;
  --green-dim: #8fae96;
  --red: #8b2e2e;
  --blue: #2b579a;
  --violet: #5a4a7a;
  --mono: "Courier New", "Consolas", "Lucida Console", monospace;
  --sans: Tahoma, "MS Sans Serif", Verdana, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: none;
}

a {
  color: #000080;
  text-decoration: underline;
  border: 0;
}

a:hover {
  color: #0000ff;
  background: #ffffcc;
}

code,
kbd,
pre,
.mono {
  font-family: var(--mono);
}

code {
  background: var(--panel-2);
  border: 1px solid #c0c0c0;
  padding: 0 3px;
  font-size: 12px;
  color: var(--ink);
}

pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 6px 8px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  margin: 6px 0;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  margin: 0 0 4px;
}

h1 {
  font-size: clamp(20px, 3vw, 30px);
}

h2 {
  font-size: 15px;
  margin: 14px 0 5px;
  padding: 2px 5px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
}

h3 {
  font-size: 13px;
  margin: 10px 0 3px;
  color: var(--ink);
}

h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  margin: 0 0 3px;
}

p {
  margin: 0 0 6px;
}

ul,
ol {
  padding-left: 18px;
  margin: 0 0 6px;
}

li {
  margin: 1px 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 10px 0;
}

blockquote {
  margin: 8px 0;
  padding: 4px 8px;
  border-left: 4px solid var(--accent);
  background: var(--panel-2);
  color: #3a3a3a;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* -------------------------------------------------------------------------- */
/*  Layout                                                                    */
/* -------------------------------------------------------------------------- */

.wrap {
  width: min(1180px, calc(100% - 16px));
  margin: 0 auto;
}

.wrap-narrow {
  width: min(820px, calc(100% - 16px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 #ffffff;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  border: 0;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--ink);
  background: transparent;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #000000;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-family: var(--mono);
}

.brand small {
  color: var(--ink-dim);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink);
  border: 1px solid var(--line);
  border-top-color: #ffffff;
  border-left-color: #ffffff;
  background: var(--bg);
  padding: 2px 6px;
  font-size: 11px;
  font-family: var(--sans);
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--bg-2);
  color: #000000;
}

.site-nav a[aria-current="page"] {
  background: var(--bg-3);
  border-color: var(--line-bright) #ffffff #ffffff var(--line-bright);
  font-weight: 700;
}

.page {
  padding: 10px 0 20px;
}

.hero {
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 14px;
  align-items: start;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}

.lede {
  font-size: 13px;
  color: #3a3a3a;
  max-width: 70ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid #000000;
  border-top-color: #ffffff;
  border-left-color: #ffffff;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}

.button:hover {
  background: var(--bg-2);
  color: #000000;
}

.button:active {
  border-color: #000000 #ffffff #ffffff #000000;
  background: #b0b0b0;
}

.button.primary {
  background: var(--accent);
  border-color: #000000;
  border-top-color: var(--accent-dim);
  border-left-color: var(--accent-dim);
  color: #ffffff;
  font-weight: 700;
}

.button.primary:hover {
  background: var(--blue);
  color: #ffffff;
}

.button.ghost {
  background: transparent;
}

/* -------------------------------------------------------------------------- */
/*  Cards and grids                                                           */
/* -------------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 6px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top-color: #ffffff;
  border-left-color: #ffffff;
  padding: 6px 8px;
  box-shadow: 1px 1px 0 var(--line);
}

.card h3 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

.card-link {
  display: block;
  color: inherit;
  border: 1px solid var(--line);
  border-top-color: #ffffff;
  border-left-color: #ffffff;
  text-decoration: none;
}

.card-link:hover {
  background: var(--panel-2);
  border-color: var(--accent);
  color: inherit;
}

.card-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.card-body {
  color: var(--ink-dim);
  font-size: 12px;
  margin: 0;
}

.pill {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.pill.green {
  color: var(--green);
  border-color: var(--green);
  background: #eef5ef;
}

.pill.amber {
  color: var(--accent);
  border-color: var(--accent);
  background: #eef2f7;
}

.pill.red {
  color: var(--red);
  border-color: var(--red);
  background: #fbf0f0;
}

/* -------------------------------------------------------------------------- */
/*  Documentation furniture                                                   */
/* -------------------------------------------------------------------------- */

.doc-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.doc-side {
  position: sticky;
  top: 42px;
  font-size: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-top-color: #ffffff;
  border-left-color: #ffffff;
  padding: 5px;
}

.doc-side h4 {
  margin: 0 0 3px;
}

.doc-side a {
  display: block;
  color: var(--ink);
  border: 0;
  padding: 1px 2px;
  font-family: var(--sans);
  font-size: 11px;
  text-decoration: none;
}

.doc-side a:hover {
  background: #000080;
  color: #ffffff;
}

.doc-side .side-group {
  margin-bottom: 8px;
}

.doc-body {
  min-width: 0;
}

.doc-body > h2:first-child {
  margin-top: 0;
}

.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--panel-2);
  padding: 5px 7px;
  margin: 8px 0;
}

.callout.warn {
  border-left-color: #8a6a2f;
  background: #fbf7ee;
}

.callout.danger {
  border-left-color: var(--red);
  background: #fbf0f0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 12px;
  border: 1px solid var(--line);
}

th,
td {
  text-align: left;
  padding: 3px 5px;
  border: 1px solid #c0c0c0;
  vertical-align: top;
}

th {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--bg-2);
  border-color: var(--line);
}

td code {
  white-space: nowrap;
}

.kv {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 2px 8px;
  font-size: 12px;
}

.kv dt {
  font-family: var(--mono);
  color: var(--ink-dim);
}

.kv dd {
  margin: 0;
}

/* -------------------------------------------------------------------------- */
/*  Example shell                                                             */
/* -------------------------------------------------------------------------- */

.example-header {
  border-bottom: 1px solid var(--line);
  padding: 8px 0 6px;
  margin-bottom: 8px;
}

.example-header h1 {
  font-size: 20px;
  margin-bottom: 2px;
}

.example-header p {
  color: var(--ink-dim);
  max-width: 80ch;
  margin: 0;
  font-size: 12px;
}

.example-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 8px;
  align-items: start;
}

.example-grid.wide-right {
  grid-template-columns: 280px minmax(0, 1fr);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top-color: #ffffff;
  border-left-color: #ffffff;
  padding: 5px 7px;
  box-shadow: 1px 1px 0 var(--line);
}

.panel h3 {
  margin: 0 0 4px;
  font-size: 11px;
  font-family: var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1px 4px;
}

.panel + .panel {
  margin-top: 6px;
}

.stage {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top-color: var(--line-bright);
  border-left-color: var(--line-bright);
  overflow: hidden;
}

.stage canvas {
  display: block;
  width: 100%;
  height: auto;
}

.stage-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink);
}

/* -------------------------------------------------------------------------- */
/*  Controls                                                                  */
/* -------------------------------------------------------------------------- */

.control {
  margin-bottom: 5px;
}

.control:last-child {
  margin-bottom: 0;
}

.control-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 1px;
}

.control label {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink);
}

.control output {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}

input[type="range"] {
  width: 100%;
  height: 12px;
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-top-color: var(--line-bright);
  border-left-color: var(--line-bright);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 16px;
  background: var(--bg);
  border: 1px solid #000000;
  border-top-color: #ffffff;
  border-left-color: #ffffff;
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 16px;
  background: var(--bg);
  border: 1px solid #000000;
  border-top-color: #ffffff;
  border-left-color: #ffffff;
}

input[type="checkbox"] {
  appearance: none;
  width: 12px;
  height: 12px;
  border: 1px solid #000000;
  border-top-color: var(--line);
  border-left-color: var(--line);
  background: var(--panel);
  vertical-align: -1px;
  position: relative;
  cursor: pointer;
}

input[type="checkbox"]:checked {
  background: var(--accent);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 6px;
  height: 6px;
  background: #ffffff;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink);
  margin-bottom: 2px;
  cursor: pointer;
}

.toggle-row:last-child {
  margin-bottom: 0;
}

select {
  width: 100%;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-top-color: var(--line-bright);
  border-left-color: var(--line-bright);
  padding: 1px 2px;
  font-family: var(--sans);
  font-size: 11px;
}

/* -------------------------------------------------------------------------- */
/*  Readouts                                                                  */
/* -------------------------------------------------------------------------- */

.bars {
  display: grid;
  gap: 2px;
}

.bar-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 48px;
  gap: 4px;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
}

.bar-row .bar-label {
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  display: block;
  height: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-top-color: var(--line-bright);
  border-left-color: var(--line-bright);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
}

.bar-fill.amber {
  background: #8a6a2f;
}

.bar-fill.red {
  background: var(--red);
}

.bar-fill.blue {
  background: var(--blue);
}

.bar-value {
  text-align: right;
  color: var(--ink-dim);
}

.chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 3px 5px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  font-family: var(--mono);
  font-size: 11px;
  margin-bottom: 5px;
}

.chosen strong {
  color: var(--accent);
  font-size: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 0;
  border-bottom: 1px dotted #c0c0c0;
}

.stat-row:last-child {
  border-bottom: 0;
}

.stat-row span:first-child {
  color: var(--ink-faint);
}

.stat-row span:last-child {
  color: var(--ink);
}

/* -------------------------------------------------------------------------- */
/*  Behaviour tree inspector                                                  */
/* -------------------------------------------------------------------------- */

.bt {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.4;
}

.bt-node {
  position: relative;
  margin: 1px 0;
  padding: 1px 3px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
}

.bt-node[data-status="success"] {
  border-color: var(--green);
  color: var(--green);
  background: #eef5ef;
}

.bt-node[data-status="failure"] {
  border-color: var(--red);
  color: var(--red);
  background: #fbf0f0;
}

.bt-node[data-status="running"] {
  border-color: var(--accent);
  color: var(--accent);
  background: #eef2f7;
}

.bt-children {
  margin-left: 8px;
  padding-left: 6px;
  border-left: 1px dotted var(--line);
}

.bt-kind {
  color: var(--ink-faint);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 3px;
}

/* -------------------------------------------------------------------------- */
/*  Legend and misc                                                           */
/* -------------------------------------------------------------------------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-dim);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border: 1px solid #000000;
}

.dot.green { background: var(--green); }
.dot.amber { background: var(--accent); }
.dot.red { background: var(--red); }
.dot.blue { background: var(--blue); }
.dot.violet { background: var(--violet); }

.formula {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 4px 6px;
  overflow-x: auto;
  margin: 6px 0;
}

.formula em {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 8px 0 12px;
  color: var(--ink-dim);
  font-size: 11px;
  background: var(--bg-2);
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: baseline;
}

.footer a {
  color: #000080;
}

.small {
  font-size: 11px;
  color: var(--ink-dim);
}

.tiny {
  font-size: 10px;
  color: var(--ink-faint);
  font-family: var(--mono);
}

.nowrap {
  white-space: nowrap;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }

/* -------------------------------------------------------------------------- */
/*  Responsive                                                                */
/* -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .hero-grid,
  .example-grid,
  .example-grid.wide-right,
  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .doc-side {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 5px;
  }

  .doc-side .side-group {
    margin-bottom: 0;
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-header .wrap {
    flex-wrap: wrap;
    padding: 2px 0;
  }

  .site-nav {
    width: 100%;
    margin-left: 0;
  }

  .bar-row {
    grid-template-columns: 72px minmax(0, 1fr) 42px;
  }
}
