/* ==========================================================================
   harness.css — page-scoped styles for /harness (Saturn AI Desktop).
   Loaded AFTER /assets/css/global.css, which owns every token, the faces,
   the shell and the shared objects (.card .facts .steps .faq .pill .state).
   Nothing here declares a font, a colour literal, a shadow or a gradient:
   every value resolves to a contract token (the legacy short aliases --bg,
   --ink, --surface, --accent, --line resolve to the --saturn-* tokens).
   Depth is hairlines only. One radius: the card radius, 16px.
   ========================================================================== */

/* -------------------------------------------------------------- the card */

.card.feature + .card.feature { margin-top: 16px; }
.card.feature .card-body > .acts { margin-top: 16px; }

/* --------------------------------------------------------- the role map  */
/* An illustration of SaturnBot's five roles. The canvas (harness.js) paints
   the ring, the routes and the travelling light; the buttons are real DOM,
   positioned on the same fractions the script uses for its route endpoints. */

.role-map {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in oklch, var(--bg) 62%, transparent);
  overflow: hidden;
}

#role-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* The static stand-in when there is no 2D context at all. */
.orbit-fallback {
  position: absolute;
  inset: 14% 10%;
  border: 1px solid var(--line);
  border-radius: 50%;
  transform: rotate(-18deg) scale(1, 0.62);
  transform-origin: center;
}
.role-map[data-canvas-ready] .orbit-fallback { display: none; }

.map-cross {
  position: absolute;
  font: 400 var(--saturn-type-label)/1 var(--font-mono);
  color: var(--line-strong);
  user-select: none;
}
.cross-one { left: 5%; top: 9%; }
.cross-two { right: 5%; bottom: 9%; }

.role-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 9px 13px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--saturn-pill);
  background: color-mix(in oklch, var(--surface) 82%, transparent);
  color: var(--ink-muted);
  font: 400 var(--saturn-type-label)/1.3 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color var(--saturn-dur-1) var(--saturn-ease-standard),
    border-color var(--saturn-dur-1) var(--saturn-ease-standard),
    background-color var(--saturn-dur-1) var(--saturn-ease-standard);
}
.role-node:hover { color: var(--ink); border-color: var(--line-strong); }
.role-node[aria-pressed='true'] {
  color: var(--ink);
  border-color: var(--line-strong);
  background: color-mix(in oklch, var(--accent) 12%, var(--surface));
}
.role-node small {
  display: block;
  color: var(--ink-muted);
  font: inherit;
  letter-spacing: .14em;
}
.role-node[aria-pressed='true'] small { color: var(--accent); }

.core-node { left: 50%; top: 48%; border-radius: 16px; padding: 12px 18px; }
.node-developer { left: 21%; top: 24%; }
.node-growth { left: 79%; top: 24%; }
.node-operations { left: 21%; top: 77%; }
.node-finance { left: 79%; top: 77%; }

/* The program's glyph (the same geometry as the top bar and the app icon). */
.core-icon { color: var(--ink-muted); }
.core-icon svg {
  width: 52px;
  height: auto;
  stroke: currentColor;
  stroke-width: 4.5;
  fill: none;
}
.role-node[aria-pressed='true'] .core-icon { color: var(--accent); }

.node-symbol {
  font-family: var(--font-mono);
  font-size: var(--saturn-type-meta);
  color: inherit;
}

.map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  font: 400 var(--saturn-type-meta)/1.5 var(--font-mono);
  color: var(--ink-muted);
}

#motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--saturn-pill);
  background: transparent;
  color: var(--ink-muted);
  font: 400 var(--saturn-type-label)/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  cursor: pointer;
  transition:
    color var(--saturn-dur-1) var(--saturn-ease-standard),
    border-color var(--saturn-dur-1) var(--saturn-ease-standard);
}
#motion-toggle:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); }
#motion-toggle:disabled { opacity: .6; cursor: default; }

.role-detail {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--saturn-rule-soft);
  display: grid;
  gap: 8px;
}
.detail-index {
  font: 400 var(--saturn-type-label)/1 var(--font-mono);
  letter-spacing: .16em;
  color: var(--accent);
}
.role-detail h3 { margin: 0 0 6px; }
.role-detail p { margin: 0; font-size: var(--saturn-type-p2); line-height: 1.55; color: var(--ink-muted); }
.role-capabilities {
  margin-top: 8px;
  font: 400 var(--saturn-type-meta)/1.6 var(--font-mono);
  color: var(--ink-muted);
}
.role-capabilities span { color: var(--line-strong); margin: 0 6px; }

/* ------------------------------------------------- the three illustrations */

.artifact {
  border: 1px solid var(--saturn-rule-soft);
  border-radius: 16px;
  background: color-mix(in oklch, var(--bg) 52%, transparent);
  padding: clamp(14px, 2.2vw, 20px);
  display: grid;
  gap: 10px;
}
.artifact-cap,
.artifact-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  font: 400 var(--saturn-type-label)/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-muted);
}
.artifact-foot {
  text-transform: none;
  letter-spacing: normal;
  padding-top: 10px;
  border-top: 1px solid var(--saturn-rule-soft);
  font-size: var(--saturn-type-meta);
}

.file-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--saturn-rule-soft);
}
.file-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--saturn-pill);
  font: 400 12px/1 var(--font-mono);
  color: var(--ink-muted);
}
.file-row b,
.flow-list b {
  display: block;
  font: 500 var(--saturn-type-p2)/1.35 var(--font-display);
  letter-spacing: -.005em;
  color: var(--ink);
}
.file-row small,
.flow-list small {
  display: block;
  margin-top: 2px;
  font: 400 var(--saturn-type-meta)/1.5 var(--font-mono);
  color: var(--ink-muted);
}

.flow-list { list-style: none; margin: 0; padding: 0; display: grid; }
.flow-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--saturn-rule-soft);
}
.flow-n {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--saturn-pill);
  font: 400 11px/1 var(--font-mono);
  color: var(--accent);
}

/* ------------------------------------------------- the window illustration */

.mini-harness {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in oklch, var(--surface) 70%, transparent);
  overflow: hidden;
}
.mini-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--saturn-rule-soft);
  font: 400 var(--saturn-type-meta)/1 var(--font-mono);
  color: var(--ink-muted);
}
.mini-topbar button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--saturn-pill);
  background: transparent;
  color: var(--ink);
  font: 400 var(--saturn-type-label)/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  cursor: pointer;
  transition: border-color var(--saturn-dur-1) var(--saturn-ease-standard);
}
.mini-topbar button:hover { border-color: var(--line-strong); }
.mini-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 14px;
  font-size: var(--saturn-type-p2);
  color: var(--ink-muted);
}
.mini-orbit {
  flex: none;
  width: 44px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transform: rotate(-18deg);
}
.mini-bot {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--saturn-rule-soft);
  background: color-mix(in oklch, var(--bg) 55%, transparent);
  animation: harness-restore var(--saturn-dur-2) var(--saturn-ease-out) both;
}
.mini-bot[hidden] { display: none; }
.mini-bot.is-restoring { animation: harness-restore var(--saturn-dur-2) var(--saturn-ease-out) both; }
@keyframes harness-restore { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
.mini-bot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: 500 var(--saturn-type-p2)/1.3 var(--font-display);
}
.mini-bot-bar button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--saturn-pill);
  background: transparent;
  color: var(--ink-muted);
  font: 400 14px/1 var(--font-mono);
  cursor: pointer;
}
.mini-bot-bar button:hover { color: var(--ink); border-color: var(--line-strong); }
.mini-role,
.mini-bot label,
.demo-input-note {
  margin: 0;
  font: 400 var(--saturn-type-label)/1.5 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-muted);
}
.mini-role { color: var(--accent); }
.demo-input-note { text-transform: none; letter-spacing: normal; }
#demo-draft {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--saturn-pill);
  background: color-mix(in oklch, var(--bg) 70%, transparent);
  color: var(--ink);
  font: 400 16px/1.4 var(--font-mono);
  transition: border-color var(--saturn-dur-1) var(--saturn-ease-standard);
}
#demo-draft:focus-visible { border-color: var(--line-strong); }

/* ------------------------------------------------------- release + download */

.notes { margin: 20px 0 0; padding-left: 1.1em; display: grid; gap: 8px; }
.notes li { font-size: var(--saturn-type-p2); line-height: 1.55; color: var(--ink-muted); }

.download-checksum {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  /* No min-height here: with an aspect-ratio a minimum height transfers into a
     minimum WIDTH, which pushed the map past its card and scrolled the page. */
  .role-map { aspect-ratio: 1 / 1.15; }
  .role-node { padding: 7px 10px; }
  .core-icon svg { width: 38px; }
  .map-footer { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .role-node { font-size: 10px; }
  .artifact-cap, .artifact-foot { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .mini-bot, .mini-bot.is-restoring { animation: none; }
}

/* The illustrated window controls are real buttons: the 44px floor applies. */
.mini-topbar button, .mini-bot-bar button { min-height: 44px; min-width: 44px; }

/* The illustration's caption rows span the whole panel, not the 72ch paragraph measure. */
.card-body .artifact-cap, .card-body .artifact-foot { max-width: none; }
