/* terransoul.com layout. Colours and type come only from tokens.css (terranimus.com). */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.55;
}
a { color: var(--clay-ink); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; margin: 0 0 0.5em; }
h1 { font-size: var(--t-h1); font-variation-settings: 'opsz' 72; }
h2 { font-size: var(--t-h2); font-variation-settings: 'opsz' 48; }
h3 { font-size: var(--t-h3); }
p { margin: 0 0 1em; max-width: var(--measure); }
code, kbd { font-family: var(--mono); font-size: 0.92em; background: var(--paper-sunk); padding: 0.1em 0.35em; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* Top bar */
.top { border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 4rem; flex-wrap: wrap; }
.mark { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--ink); text-decoration: none; margin-right: auto; }
.top nav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: var(--t-small); }
.top nav a { color: var(--ink-soft); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.theme { background: none; border: 1px solid var(--rule-strong); color: var(--ink-soft); border-radius: 999px; padding: 0.3rem 0.7rem; font: inherit; font-size: var(--t-small); cursor: pointer; }

/* Buttons: one primary per screen. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1.15rem; border-radius: 999px;
  border: 1px solid var(--rule-strong); background: transparent; color: var(--ink);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--paper-sunk); }
.btn.primary { background: var(--clay); border-color: var(--clay); color: var(--on-clay); }
.btn.primary:hover { filter: brightness(0.96); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0; }

section { padding: var(--section-y) 0; border-top: 1px solid var(--rule); }
section:first-of-type { border-top: 0; }

/* Hero: one dominant picture. */
.hero { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; }
.lede { font-size: var(--t-lead); color: var(--ink-soft); }
.frame {
  aspect-ratio: 4 / 3; border-radius: 14px; background: var(--paper-deep);
  border: 1px solid var(--rule); display: grid; place-items: center;
  color: var(--ink-faint); font-size: var(--t-small); padding: 1.5rem; text-align: center;
}

/* Companion: a split list. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2.5rem; }
.defs { margin: 0; }
.defs dt { font-weight: 600; margin-top: 1rem; }
.defs dd { margin: 0.2rem 0 0; color: var(--ink-soft); }

/* Modes: a numbered row. */
.modes { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule-strong); }
.modes li { padding: 1rem 1rem 0 0; }
.modes b { font-family: var(--serif); font-size: var(--t-h3); display: block; font-weight: 500; }
.modes span { color: var(--ink-soft); font-size: var(--t-small); }

/* Figures table */
.figures { width: 100%; border-collapse: collapse; margin: 1.25rem 0; }
.figures th, .figures td { text-align: left; vertical-align: top; padding: 0.8rem 0.75rem 0.8rem 0; border-bottom: 1px solid var(--rule); }
.figures th { font-weight: 600; white-space: nowrap; }
.figures td.num { font-family: var(--serif); font-size: var(--t-h3); white-space: nowrap; }

.quote { font-family: var(--serif); font-size: var(--t-h3); max-width: 34rem; }
.note { color: var(--ink-faint); font-size: var(--t-small); }
.own-cloud { background: var(--paper-sunk); border-left: 4px solid var(--ink); border-radius: 10px; padding: 0.4rem 1rem; max-width: var(--measure); }
pre.cmd { font-family: var(--mono); background: var(--paper-sunk); border-radius: 10px; padding: 1rem; overflow-x: auto; }

details { border-bottom: 1px solid var(--rule); padding: 0.9rem 0; max-width: var(--measure); }
summary { cursor: pointer; font-weight: 500; }
details p { margin: 0.6rem 0 0; color: var(--ink-soft); }

.foot { border-top: 1px solid var(--rule); padding: 2.5rem 0; color: var(--ink-faint); font-size: var(--t-small); }
.foot .wrap { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.foot a { color: var(--ink-soft); }

/* Sign-in card (house .auth layout) */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth { width: min(26rem, 100%); background: var(--paper-sunk); border: 1px solid var(--rule); border-radius: 18px; padding: 2rem 1.5rem; }
.auth h1 { font-size: var(--t-h2); }
.auth .btn { width: 100%; margin: 0.4rem 0; }
.auth .or { text-align: center; color: var(--ink-faint); margin: 0.9rem 0; font-size: var(--t-small); }
.auth input[type=email] { width: 100%; padding: 0.7rem 0.9rem; border-radius: 12px; border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); font: inherit; }
.auth .secured { margin-top: 1.25rem; font-size: var(--t-small); color: var(--ink-faint); }
.alert { border: 1px solid var(--clay-ring); background: var(--clay-soft); color: var(--ink); padding: 0.7rem 0.9rem; border-radius: 10px; font-size: var(--t-small); }

/* Agents page */
.pcs { display: grid; gap: 1rem; margin: 1.5rem 0; }
.pc { border: 1px solid var(--rule); border-radius: 14px; padding: 1.25rem; background: var(--paper-sunk); }
.pc header { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: baseline; }
.pc h3 { margin: 0; margin-right: auto; }
.dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ink-faint); margin-right: 0.35rem; }
.dot.on { background: var(--clay); }
.agents { list-style: none; padding: 0; margin: 1rem 0 0; }
.agents li { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; padding: 0.6rem 0; border-top: 1px solid var(--rule); }
.agents .name { margin-right: auto; }
.tag { font-family: var(--mono); font-size: var(--t-small); border: 1px solid var(--rule-strong); border-radius: 6px; padding: 0.05rem 0.4rem; }
form.launch { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1rem; }
form.launch fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 0.9rem; }
form.launch input[type=text], .remote .tb-bar input, .console textarea, select {
  padding: 0.55rem 0.75rem; border-radius: 10px; border: 1px solid var(--rule-strong);
  background: var(--paper); color: var(--ink); font: inherit;
}
.remote { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.remote h4 { margin: 0 0 0.6rem; }
.remote .seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; margin-bottom: 0.75rem; }
.remote .seg button { border: 0; background: transparent; color: inherit; font: inherit; padding: 0.35rem 0.9rem; cursor: pointer; }
.remote .seg button[aria-checked=true] { background: var(--paper); font-weight: 600; }
.remote .voice-explain { margin: 0.5rem 0 0.75rem; padding: 0.75rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); }
.remote .voice-devices { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.75rem; }
.remote .voice-devices label { display: flex; flex-direction: column; gap: 0.25rem; flex: 1 1 12rem; min-width: 0; }
.remote .voice-devices select { width: 100%; }
.remote .file-pick { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.remote .file-pick input[type=file] { flex: 1 1 14rem; min-width: 0; max-width: 100%; }
.remote .file-progress { display: block; width: 100%; height: 0.5rem; margin-top: 0.75rem; accent-color: var(--clay); }
.remote .tb-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.75rem 0; }
.remote .tb-bar input { flex: 1 1 14rem; min-width: 0; }
.remote .tb-view { aspect-ratio: 16 / 10; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--paper); display: flex; align-items: center; justify-content: center; }
.remote .tb-view:focus { outline: 2px solid currentColor; outline-offset: 2px; }
.remote .tb-view img { width: 100%; height: 100%; object-fit: contain; cursor: default; user-select: none; touch-action: none; }
.console { margin-top: 1rem; border: 1px solid var(--rule); border-radius: 12px; padding: 1rem; background: var(--paper); }
.console .log { font-family: var(--mono); font-size: var(--t-small); white-space: pre-wrap; max-height: 22rem; overflow-y: auto; margin: 0 0 0.75rem; }
.console textarea { width: 100%; min-height: 4.5rem; resize: vertical; }
.approval { border: 1px solid var(--clay-ring); border-radius: 10px; padding: 0.75rem; margin: 0.5rem 0; }
/* BT-15: bot teams on /app. Names and replies come from the PC, so long words wrap instead of widening a phone screen. */
.teams { margin-top: 2.5rem; }
.bot-team { border: 1px solid var(--rule); border-radius: 14px; padding: 1.25rem; background: var(--paper-sunk); margin-top: 1rem; }
.bot-team header { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: baseline; }
.bot-team h3 { margin: 0; margin-right: auto; overflow-wrap: anywhere; }
.bot-team .agents .name, .bot-team .log, .bot-chat .log { overflow-wrap: anywhere; }
.bot-team .room { margin-top: 1rem; }
.bot-team .room textarea, .bot-chat textarea {
  box-sizing: border-box; width: 100%; min-height: 4rem; resize: vertical; padding: 0.55rem 0.75rem; border-radius: 10px;
  border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); font: inherit;
}
.bot-team .log { font-family: var(--mono); font-size: var(--t-small); white-space: pre-wrap; max-height: 18rem; overflow-y: auto; margin: 0.75rem 0 0; }
.bot-team .log:empty, .bot-chat .log:empty { display: none; }
.teams form.launch input[type=text], .teams select { min-width: 0; max-width: 100%; }
/* BT-15 on BT-5: Team map, approvals inbox and a bot's settings pages. Same tokens; one column on a phone. */
.team-views { flex-wrap: wrap; }
.team-views .tag { margin-left: 0.3rem; }
.map-head { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: baseline; }
.map-head h3 { margin: 0; }
.team-canvas {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem; padding: 1rem; margin: 0.75rem 0 1rem;
  border: 1px solid var(--rule); border-radius: 14px; background-color: var(--paper-sunk);
  background-image: radial-gradient(var(--rule-strong) 1px, transparent 1px); background-size: 18px 18px;
}
.team-canvas:empty { display: none; }
.dept { border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--paper); padding: 0.75rem; min-width: 0; }
.dept header { display: flex; gap: 0.5rem; align-items: baseline; }
.dept h4 { margin: 0; margin-right: auto; overflow-wrap: anywhere; }
.map-bots { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.map-bot { display: flex; gap: 0.6rem; align-items: center; border: 1px solid var(--rule); border-radius: 10px; padding: 0.5rem; background: var(--paper-sunk); min-width: 0; }
.map-bot .avatar { flex: none; width: 2rem; height: 2rem; border-radius: 999px; display: grid; place-items: center; background: var(--clay-soft); color: var(--ink); font-weight: 600; }
.map-bot .who { display: grid; min-width: 0; margin-right: auto; }
.map-bot .name, .map-bot .note { overflow-wrap: anywhere; }
.map-bot .edge { font-family: var(--mono); font-size: var(--t-small); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 0.05rem 0.5rem; white-space: nowrap; }
.map-bot .edge[data-edge=running] { background: var(--clay); border-color: var(--clay); color: var(--on-clay); }
.map-bot .edge[data-edge=queued] { border-color: var(--clay-ring); background: var(--clay-soft); }
.map-bot .edge[data-edge=stopped] { color: var(--ink-faint); }
.map-activity { font-family: var(--mono); font-size: var(--t-small); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 14rem; overflow-y: auto; }
.map-activity:empty::before { content: 'Nothing new yet.'; color: var(--ink-faint); }
.card .card-lines p { margin: 0.25rem 0; overflow-wrap: anywhere; white-space: pre-wrap; }
/* BT-11: a launched tool's whole permission request (secret-redacted on the PC). */
.card .card-input pre { font-family: var(--mono); font-size: var(--t-small); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 16rem; overflow: auto; margin: 0.25rem 0; padding: 0.4rem 0.6rem; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--paper-sunk); }
.bot-panel .panel-page { display: grid; gap: 0.75rem; }
.bot-panel label { display: grid; gap: 0.3rem; }
.bot-panel input[type=text], .bot-panel select { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; }
.bot-panel input[type=text] { padding: 0.55rem 0.75rem; border-radius: 10px; border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); font: inherit; }
.bot-panel input[type=range] { width: 100%; accent-color: var(--clay); }
.bot-panel .memories { margin: 0; padding-left: 1.2rem; }
.bot-panel .memories li { overflow-wrap: anywhere; margin: 0.25rem 0; }
.bot-chat label.note { display: inline-flex; gap: 0.35rem; align-items: center; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .hero, .split { grid-template-columns: 1fr; }
  .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures th { white-space: normal; }
}

/* Brand mark next to the wordmark. */
.mark { display: inline-flex; align-items: center; gap: 0.5rem; }
.mark img { display: block; flex: none; }

/* Live stages: hologram character and demo memory graph. */
.stage {
  position: relative; overflow: hidden; padding: 0; margin: 0;
  background: radial-gradient(ellipse at 50% 85%, var(--holo-bg) 0%, var(--holo-bg-edge) 75%);
  border-color: var(--holo-line);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-note {
  position: absolute; left: 0.75rem; bottom: 0.6rem; z-index: 2;
  font-family: var(--mono); font-size: var(--t-eyebrow); letter-spacing: 0.06em;
  color: var(--holo-ink);
}
/* The hero character keeps her own lit, opaque materials; the hologram layers are drawn on top in WebGL and never over
   her face (owner 2026-11-05). The stage is dark in both themes; in the light theme it gets a stronger edge and a soft
   shadow so it does not read as a hole in the page. */
.stage.avatar .stage-note { top: 0.6rem; bottom: auto; }
.stage.avatar { box-shadow:0 18px 40px -24px color-mix(in oklch, var(--ink) 45%, transparent); }
.holo-view { position: absolute; inset: 0; }
.holo-view .poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.stage.ready .poster { opacity: 0; }
.stage-controls { position: absolute; right: 0.6rem; bottom: 0.5rem; z-index: 2; display: flex; gap: 0.5rem; }
.holo-btn {
  font: inherit; font-family: var(--mono); font-size: var(--t-eyebrow); letter-spacing: 0.06em;
  color: var(--holo-ink); background: color-mix(in oklch, var(--holo-bg-edge) 70%, transparent);
  border: 1px solid color-mix(in oklch, var(--holo) 40%, transparent); border-radius: 999px;
  padding: 0.3rem 0.75rem; cursor: pointer;
}
.holo-btn:hover { border-color: var(--holo); }
.holo-btn[data-holo-pause]::before { content: '\2016'; margin-right: 0.45em; }
.holo-btn[aria-pressed='true']::before { content: '\25B8'; }
.holo-btn:focus-visible { outline: 2px solid var(--holo); outline-offset: 2px; }
.hero-sub { color: var(--ink-soft); font-size: var(--t-small); }
@media (max-width: 760px) { .stage.avatar { aspect-ratio: 3 / 4; } }
@media (prefers-color-scheme: light) { :root:not([data-theme='dark']) .stage.avatar { border-color: var(--rule-strong); } }
:root[data-theme='light'] .stage.avatar { border-color: var(--rule-strong); }

/* COMPANY-BOTS-4: the Personal | Company toggle and the company switcher on /app (ADR 041 §8). */
.scope { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 10px; overflow: hidden; margin: 0.5rem 0 1rem; }
.scope button { font: inherit; padding: 0.45rem 1rem; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.scope button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.company-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.switcher { position: relative; }
.switcher summary { cursor: pointer; list-style: none; border: 1px solid var(--rule-strong); border-radius: 10px; padding: 0.45rem 0.9rem; }
.switcher summary::after { content: " \25BE"; }
.switcher-menu { position: absolute; z-index: 5; min-width: 16rem; max-width: calc(100vw - 32px); margin-top: 0.3rem; padding: 0.5rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); }
.switcher-menu ul { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.switcher-menu li a { display: block; padding: 0.4rem 0.5rem; border-radius: 8px; color: var(--ink); text-decoration: none; }
.switcher-menu li a[aria-current="true"] { background: var(--paper-sunk); }
