/* harness-multitool.dev. The colours are the TUI's own themes (harness-multitool themes/dark.toml
   and light.toml); the brand orange is the same in both. No web fonts: nothing is fetched from
   anywhere else. */
:root {
  --bg: #0B0E14; --surface: #171B23; --raised: #232833; --border: #343B47;
  --text: #F2F2ED; --muted: #AEB8C5; --accent: #F5A623; --accent-text: #201400; --accent-line: #F5A623;
  --success: #70DB9B; --brand: #F5A623; --selection: #46371F;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --radius: 6px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #FBFAF8; --surface: #F1F0EE; --raised: #E5E4E1; --border: #D2D0CB;
  --text: #20242A; --muted: #535C68; --accent: #A65900; --accent-text: #FFFFFF; --accent-line: #C97400;
  --success: #1E7549; --selection: #FBE0B8;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #FBFAF8; --surface: #F1F0EE; --raised: #E5E4E1; --border: #D2D0CB;
    --text: #20242A; --muted: #535C68; --accent: #A65900; --accent-text: #FFFFFF; --accent-line: #C97400;
    --success: #1E7549; --selection: #FBE0B8;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--mono); }
::selection { background: var(--selection); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

/* The logo follows the theme: the tools take the text colour, as the TUI recolours them. */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline; }
:root[data-theme="dark"] .logo-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .logo-dark { display: inline; }
  :root[data-theme="auto"] .logo-light { display: none; }
}

/* The top bar. */
.topbar { display: flex; align-items: center; justify-content: space-between; max-width: 1120px; margin: 0 auto; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav a { color: var(--text); }
.theme-switch { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); cursor: pointer; position: relative; }
.theme-switch::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: linear-gradient(90deg, var(--text) 50%, transparent 50%); border: 1px solid var(--text); }

main { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* The first screen. */
.hero { text-align: center; padding: 56px 0 40px; }
.hero-logo { width: min(300px, 70vw); height: auto; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); margin: 6px 0 4px; letter-spacing: -0.5px; }
.slogan { color: var(--text); font-size: 20px; font-weight: 700; margin: 0 0 10px; }
/* The CLI welcome screen's bullets, one at a time (points.js); every one at once without motion. */
.points { list-style: none; margin: 0 auto 26px; padding: 0; height: 28px; position: relative; max-width: 760px; }
.points li { position: absolute; inset: 0; color: var(--muted); font-size: 16px; opacity: 0; transform: translateY(8px); transition: opacity .6s ease, transform .6s ease; pointer-events: none; }
.points li.shown { opacity: 1; transform: none; pointer-events: auto; }
.points .tick { color: var(--accent); font-weight: 700; }
.points .tag { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--border); border-radius: 3px; font-size: 12px; color: var(--accent); vertical-align: 1px; }
@media (prefers-reduced-motion: reduce) {
  .points { height: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; text-align: left; }
  .points li { position: static; opacity: 1; transform: none; transition: none; }
}
@media (max-width: 560px) { .points { height: 52px; } .points li { font-size: 14px; } }
.install { display: flex; align-items: stretch; max-width: 880px; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.install code { flex: 1; padding: 13px 16px; text-align: left; white-space: nowrap; overflow-x: auto; scrollbar-width: none; font-size: 14px; }
.install code::-webkit-scrollbar { display: none; }
.copy { width: 46px; border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; }
.copy::before { content: "⧉"; font-size: 18px; }
.copy.done::before { content: "✓"; color: var(--success); }
.install-note { color: var(--muted); font-size: 13px; margin: 10px 0 22px; }
.install-note code { color: var(--text); }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.button { display: inline-block; padding: 10px 22px; border: 1px solid var(--accent-line); border-radius: var(--radius); color: var(--text); font-weight: 700; }
.button:hover { text-decoration: none; background: var(--raised); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.primary:hover { filter: brightness(1.08); background: var(--accent); }

/* The multitool in the page. */
.try { padding: 8px 0 40px; }
.try-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.try-head h2 { margin: 0; font-size: 24px; }
.mode { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mode button { padding: 7px 14px; border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.mode button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); font-weight: 700; }
.frame { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.frame-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.dots i:nth-child(2) { background: #FEBC2E; }
.dots i:nth-child(3) { background: #28C840; }
.progress { display: flex; align-items: center; gap: 10px; padding: 6px 8px 8px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.progress-body { flex: 1; min-width: 0; }
.progress-text b { color: var(--text); font-weight: 700; margin-right: 6px; }
.scene-arrow { flex: none; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 50%; background: var(--bg); color: var(--text); font: 700 18px/1 var(--mono); cursor: pointer; }
.scene-arrow:hover { border-color: var(--accent-line); color: var(--accent); }
.try.holding .progress-bar i { background: var(--success); }
.progress-text { display: flex; justify-content: space-between; margin-bottom: 5px; }
.progress-bar { height: 4px; background: var(--raised); border-radius: 2px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; background: var(--accent-line); transition: width .3s linear; }
.try.explore .progress { opacity: .45; }
.screen { min-height: 560px; background: var(--bg); outline: none; overflow: hidden; }
.screen:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-line); outline: none; }
.screen canvas { display: block; max-width: 100%; }
.noscript { padding: 24px; color: var(--muted); }
.caption { color: var(--muted); font-size: 13px; text-align: center; margin: 10px 0 0; }

/* The feature cards. */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px 0 40px; }
.card { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.card:hover { text-decoration: none; border-color: var(--accent-line); }
/* A card left alone on the last row takes the row. */
.features .card:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
@media (max-width: 900px) { .features .card:last-child:nth-child(3n+1) { grid-column: auto; } .features .card:last-child:nth-child(2n+1) { grid-column: 1 / -1; } }
.icon { flex: none; width: 30px; height: 30px; color: var(--accent); }
.icon svg { width: 30px; height: 30px; }
.card-text { display: flex; flex-direction: column; gap: 4px; }
.card-text span { color: var(--muted); font-size: 13px; }

/* The docs: the band on the landing page and the pages. */
.docs-band h2 { font-size: 24px; margin: 0 0 12px; }
.docs-preview, .doc-layout { display: grid; grid-template-columns: 220px 1fr; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 40px; }
.doc-layout { margin-top: 24px; min-height: 70vh; }
.sidebar { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; border-right: 1px solid var(--border); }
.sidebar a { padding: 6px 10px; border-radius: 4px; color: var(--text); font-size: 14px; }
.sidebar a:hover { background: var(--raised); text-decoration: none; }
.sidebar a.current { background: var(--selection); color: var(--accent); font-weight: 700; }
.excerpt, .doc { padding: 18px 26px 26px; min-width: 0; }
.excerpt h3 { margin: 0 0 8px; font-size: 20px; }
.excerpt pre, .doc pre { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 10px 14px; overflow-x: auto; }
.checks { list-style: none; padding: 0; }
.checks li::before { content: "✓ "; color: var(--success); }
.doc h1 { font-size: 30px; margin-top: 4px; }
.doc h2 { margin-top: 30px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.doc h2, .doc h3 { color: var(--accent); }
.doc img { max-width: 100%; height: auto; }
.doc table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 13px; margin: 14px 0; }
.doc th, .doc td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; vertical-align: top; }
.doc th { background: var(--raised); }
.doc :not(pre) > code { background: var(--raised); padding: 1px 5px; border-radius: 3px; font-size: 0.92em; }
.doc blockquote { margin: 0; padding: 4px 14px; border-left: 3px solid var(--accent-line); color: var(--muted); }
.source { margin-top: 18px; font-size: 13px; }
.sidebar .sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 10px; padding-left: 8px; border-left: 1px solid var(--border); max-height: 50vh; overflow-y: auto; }
.sidebar .sub a { font-size: 12.5px; padding: 3px 8px; color: var(--muted); }
.sidebar .sub a.current { color: var(--accent); }
.doc-layout.with-toc { grid-template-columns: 220px minmax(0, 1fr) 210px; }
.doc { max-width: 82ch; }
/* Long prose reads better in the system's own sans-serif; code and headings stay monospace. */
.doc p, .doc li, .doc td, .doc blockquote { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.65; }
.doc td { font-size: 14px; line-height: 1.5; }
.doc code { font-family: var(--mono); font-size: 0.88em; }
.toc { position: sticky; top: 12px; align-self: start; display: flex; flex-direction: column; gap: 3px; padding: 18px 14px; border-left: 1px solid var(--border); font-size: 12.5px; max-height: calc(100vh - 24px); overflow-y: auto; }
.toc strong { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 6px; }
.toc a { color: var(--text); }
.toc a.l3 { padding-left: 12px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); max-width: 48%; }
.pager a:hover { border-color: var(--accent-line); text-decoration: none; }
.pager .next { margin-left: auto; text-align: right; }
.pager small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.doc pre { position: relative; }
.doc pre .copy-code { position: absolute; top: 6px; right: 6px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--muted); font: 12px var(--mono); cursor: pointer; opacity: 0; transition: opacity .2s; }
.doc pre:hover .copy-code, .doc pre .copy-code:focus { opacity: 1; }
.doc td { min-width: 90px; }
.doc td:first-child { white-space: nowrap; }
.doc table { max-width: 100%; }

.footer { display: flex; justify-content: space-between; max-width: 1120px; margin: 0 auto; padding: 18px 24px 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

@media (max-width: 1200px) {
  .doc-layout.with-toc { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .doc-layout.with-toc { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .docs-preview, .doc-layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .topbar nav { gap: 12px; font-size: 13px; }
  .brand span { display: none; }
  .install code { font-size: 12px; }
  .screen { min-height: 420px; }
}

/* Spec ids (journal#1427): every mention links to its definition, and a definition opened by
   its link (#CON-75) is scrolled under the header and lit. */
.spec-ref { text-decoration: underline dotted; text-underline-offset: 3px; white-space: nowrap; }
.spec-id { color: inherit; scroll-margin-top: 96px; }
.spec-id:hover { color: var(--accent); }
.doc tr:has(.spec-id:target) td { background: var(--selection); }
.doc tr:has(.spec-id:target) { outline: 2px solid var(--accent-line); outline-offset: -2px; animation: spec-lit 1.4s ease 2; }
@keyframes spec-lit { 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .doc tr:has(.spec-id:target) { animation: none; } }
