:root {
  color-scheme: dark;
  --bg: #06080c;
  --surface: #0a0e15;
  --surface-raised: #0e141e;
  --line: rgba(146, 164, 184, 0.15);
  --line-strong: rgba(146, 164, 184, 0.28);
  --text: #c7d2e1;
  --text-secondary: #8794a6;
  --text-muted: #718096;
  --accent: #62efa1;
  --accent-soft: rgba(98, 239, 161, 0.12);
  --warning: #e7b56e;
  --mono: "Azeret Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --display: "Courier New", Courier, monospace;
  --shell: min(1400px, calc(100vw - 96px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 78% 10%, rgba(28, 87, 67, 0.12), transparent 32rem),
    linear-gradient(rgba(90, 109, 132, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 109, 132, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 64px 64px, 64px 64px, auto;
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.6;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

.mode-gate {
  display: none;
  width: var(--shell);
  min-height: 100svh;
  margin-inline: auto;
  padding-block: 42px 52px;
  align-content: space-between;
  grid-template-rows: auto 1fr auto auto;
  gap: 40px;
}

body[data-app-mode="gate"] .mode-gate {
  display: grid;
}

body[data-app-mode="gate"] .site-header,
body[data-app-mode="gate"] .participant-header,
body[data-app-mode="gate"] main,
body[data-app-mode="gate"] .site-footer {
  display: none;
}

.mode-gate-brand,
.participant-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  letter-spacing: 0.16em;
}

.mode-gate-copy {
  display: grid;
  max-width: 920px;
  align-content: end;
}

.mode-gate-copy > span {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.mode-gate-copy h2 {
  max-width: 820px;
  margin: 24px 0 18px;
  font-family: var(--display);
  font-size: clamp(46px, 7vw, 96px);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

.mode-gate-copy p {
  max-width: 580px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.mode-gate-options {
  display: grid;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  grid-template-columns: 1fr 1fr;
}

.mode-gate-options button {
  display: grid;
  min-height: 230px;
  padding: 26px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(145deg, rgba(18, 25, 36, 0.72), rgba(8, 11, 17, 0.92));
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, color 180ms ease;
}

.mode-gate-options button:hover:not(:disabled),
.mode-gate-options button:focus-visible:not(:disabled) {
  background: linear-gradient(145deg, var(--accent-soft), rgba(8, 11, 17, 0.92));
  color: var(--accent);
  outline: none;
}

.mode-gate-options button:disabled {
  cursor: default;
  opacity: 0.32;
}

.mode-gate-options span,
.mode-gate-options small {
  color: var(--text-muted);
}

.mode-gate-options span {
  font-size: 13px;
  letter-spacing: 0.12em;
}

.mode-gate-options strong {
  align-self: end;
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.mode-gate-options small {
  max-width: 440px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.65;
}

.mode-gate-options i {
  margin-top: 24px;
  color: var(--accent);
  font-size: 13px;
  font-style: normal;
  letter-spacing: 0.12em;
}

.mode-gate-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.participant-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: none;
  min-height: 58px;
  padding-inline: max(48px, calc((100vw - 1400px) / 2));
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 8, 12, 0.92);
  backdrop-filter: blur(18px);
}

.mode-exit {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-exit:hover,
.mode-exit:focus-visible {
  border-color: rgba(98, 239, 161, 0.5);
  color: var(--accent);
  outline: none;
}

body[data-app-mode="researcher"] .participant-header,
body[data-app-mode="researcher"] .immersive {
  display: none;
}

body[data-app-mode="participant"] .site-header,
body[data-app-mode="participant"] .hero,
body[data-app-mode="participant"] #prototype,
body[data-app-mode="participant"] #trace-analyzer,
body[data-app-mode="participant"] .method,
body[data-app-mode="participant"] .research-contract,
body[data-app-mode="participant"] .next-build,
body[data-app-mode="participant"] .site-footer,
body[data-app-mode="participant"] .immersive > .section-heading,
body[data-app-mode="participant"] .live-metrics,
body[data-app-mode="participant"] .viewport-coordinates,
body[data-app-mode="participant"] #fp-export,
body[data-app-mode="participant"] .viewport-topline > span:first-child {
  display: none;
}

body[data-app-mode="participant"] .participant-header {
  display: flex;
}

body[data-app-mode="participant"] .immersive {
  padding-top: 54px;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 68px;
  padding-inline: max(48px, calc((100vw - 1400px) / 2));
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 8, 12, 0.88);
  backdrop-filter: blur(18px);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.wordmark-module {
  color: var(--text-muted);
}

.system-state {
  display: flex;
  gap: 28px;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.hero {
  display: grid;
  min-height: calc(100svh - 68px);
  padding-block: clamp(96px, 13vh, 170px) 80px;
  align-content: center;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.45fr);
  column-gap: 56px;
}

.hero-index,
.section-index {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.hero-index {
  grid-column: 1 / -1;
}

.hero h1 {
  max-width: 1050px;
  margin: 32px 0 0;
  font-family: var(--display);
  font-size: clamp(48px, 6.4vw, 104px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.96;
  grid-column: 1 / -1;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero-copy {
  max-width: 520px;
  margin: 0;
  padding-top: 58px;
  align-self: end;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.85;
  grid-column: 2;
}

.hero-actions {
  display: flex;
  margin-top: 64px;
  align-items: center;
  gap: 28px;
  grid-column: 1 / -1;
}

.primary-action {
  display: inline-flex;
  min-height: 48px;
  padding: 0 20px;
  align-items: center;
  gap: 32px;
  border: 1px solid rgba(98, 239, 161, 0.4);
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 180ms ease, color 180ms ease;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--accent);
  color: var(--bg);
  outline: none;
}

.evidence-label {
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.prototype,
.immersive,
.trace-analyzer,
.method,
.research-contract,
.next-build {
  padding-block: 120px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  margin-bottom: 48px;
  grid-template-columns: 1fr minmax(280px, 0.58fr);
  gap: 48px;
}

.section-heading.compact {
  grid-template-columns: 1fr;
}

.section-heading h2,
.research-contract h2,
.next-build h2 {
  margin: 12px 0 0;
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 62px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.section-heading > p {
  margin: 20px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.8;
}

.simulation-frame {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: rgba(10, 14, 21, 0.88);
  grid-template-columns: minmax(0, 1.52fr) minmax(300px, 0.48fr);
}

.map-panel {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.map-toolbar,
.map-caption {
  display: flex;
  min-height: 54px;
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.map-caption {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 18px;
}

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

.legend-line {
  width: 22px;
  height: 0;
  border-top: 1px dashed var(--text-muted);
}

.legend-line.active {
  border-top: 2px solid var(--accent);
}

.legend-risk {
  width: 8px;
  height: 8px;
  border: 1px solid var(--warning);
  border-radius: 50%;
  background: rgba(231, 181, 110, 0.18);
}

.floorplan {
  display: block;
  width: 100%;
  height: auto;
  min-height: 480px;
  background:
    radial-gradient(circle at 50% 50%, rgba(98, 239, 161, 0.035), transparent 50%),
    #080b11;
}

.floor-cell {
  fill: rgba(139, 158, 181, 0.025);
  stroke: rgba(139, 158, 181, 0.08);
  stroke-width: 0.75;
}

.wall-cell {
  fill: #131a24;
  stroke: rgba(139, 158, 181, 0.16);
  stroke-width: 0.75;
}

.risk-zone {
  fill: rgba(231, 181, 110, 0.14);
  stroke: rgba(231, 181, 110, 0.45);
  stroke-width: 1;
}

.risk-label {
  fill: var(--warning);
  font-family: var(--mono);
  font-size: 13px;
  opacity: 0.78;
}

.decision-mark {
  fill: none;
  stroke: rgba(135, 148, 166, 0.38);
  stroke-width: 1;
}

.baseline-route {
  fill: none;
  stroke: rgba(135, 148, 166, 0.42);
  stroke-width: 2;
  stroke-dasharray: 6 6;
}

.selected-route {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  filter: drop-shadow(0 0 5px rgba(98, 239, 161, 0.45));
  animation: route-in 850ms cubic-bezier(.22, 1, .36, 1) both;
}

.route-node {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.space-marker {
  fill: var(--surface-raised);
  stroke: var(--text-muted);
  stroke-width: 1;
}

.space-marker.active {
  fill: var(--accent);
  stroke: var(--accent);
}

.space-label {
  fill: var(--text-secondary);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
}

@keyframes route-in {
  from {
    opacity: 0;
    stroke-dasharray: 1 240;
  }
  to {
    opacity: 1;
    stroke-dasharray: 240 0;
  }
}

.control-panel {
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 34px;
  background: linear-gradient(180deg, rgba(18, 25, 36, 0.68), rgba(8, 11, 17, 0.3));
}

.control-label {
  display: block;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.task-list,
.condition-list {
  display: grid;
  gap: 8px;
}

.task-button,
.condition-button,
.mode-button {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}

.task-button {
  display: flex;
  min-height: 50px;
  padding: 0 14px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.condition-list {
  grid-template-columns: 1fr 1fr;
}

.condition-button {
  min-height: 66px;
  padding: 11px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.condition-button span,
.condition-button small {
  display: block;
}

.condition-button span {
  font-size: 13px;
}

.condition-button small {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.task-button span:last-child {
  color: var(--text-muted);
  font-size: 13px;
}

.task-button:hover,
.task-button:focus-visible,
.task-button[aria-pressed="true"],
.condition-button:hover,
.condition-button:focus-visible,
.condition-button[aria-pressed="true"] {
  border-color: rgba(98, 239, 161, 0.5);
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.task-button:disabled,
.condition-button:disabled {
  cursor: default;
  opacity: 0.48;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.mode-button {
  min-height: 72px;
  padding: 12px;
  border-right: 0;
  text-align: center;
}

.mode-button:last-child {
  border-right: 1px solid var(--line);
}

.mode-button span,
.mode-button small {
  display: block;
}

.mode-button span {
  font-size: 13px;
}

.mode-button small {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 13px;
}

.mode-button:hover,
.mode-button:focus-visible,
.mode-button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.mode-button[aria-pressed="true"] {
  border-color: rgba(98, 239, 161, 0.5);
}

.task-question {
  margin-top: auto;
  padding: 18px;
  border-left: 2px solid var(--accent);
  background: rgba(98, 239, 161, 0.045);
}

.task-question span {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.task-question p {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

.metric-grid {
  display: grid;
  border: 1px solid var(--line-strong);
  border-top: 0;
  grid-template-columns: repeat(4, 1fr);
}

.metric-card {
  min-height: 148px;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card > span,
.metric-card small {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.metric-card strong {
  display: block;
  margin: 14px 0 9px;
  font-family: var(--display);
  font-size: 38px;
  font-weight: 400;
  line-height: 1;
}

.metric-accent strong {
  color: var(--accent);
}

.pilot-protocol {
  display: grid;
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(90deg, rgba(98, 239, 161, 0.045), transparent 42%),
    rgba(10, 14, 21, 0.9);
  grid-template-columns: minmax(260px, 1.1fr) minmax(150px, 0.45fr) minmax(260px, 0.8fr) minmax(310px, 1fr);
}

.pilot-protocol > div {
  min-width: 0;
  min-height: 190px;
  padding: 22px;
  border-right: 1px solid var(--line);
}

.pilot-protocol > div:last-child {
  border-right: 0;
}

.pilot-intro h3 {
  margin: 30px 0 10px;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.pilot-intro p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

.pilot-identity strong {
  display: block;
  margin: 31px 0 16px;
  color: var(--accent);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.pilot-identity button,
.pilot-action {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.pilot-identity button:hover:not(:disabled),
.pilot-identity button:focus-visible:not(:disabled),
.pilot-action:hover:not(:disabled),
.pilot-action:focus-visible:not(:disabled) {
  border-color: rgba(98, 239, 161, 0.5);
  color: var(--accent);
  outline: none;
}

.pilot-action.primary {
  border-color: rgba(98, 239, 161, 0.45);
  background: var(--accent-soft);
  color: var(--accent);
}

.pilot-action:disabled,
.pilot-identity button:disabled {
  cursor: default;
  opacity: 0.38;
}

.pilot-consent {
  display: grid;
  margin: 28px 0 18px;
  align-items: start;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.55;
  grid-template-columns: 18px 1fr;
  gap: 8px;
}

.pilot-consent input {
  width: 14px;
  height: 14px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.pilot-consent-block .pilot-action {
  width: 100%;
}

.pilot-progress-line {
  display: flex;
  margin: 28px 0 18px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.pilot-progress-line strong,
.pilot-progress-line span {
  display: block;
}

.pilot-progress-line strong {
  color: var(--accent);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.pilot-progress-line span {
  color: var(--text-muted);
  font-size: 13px;
  text-align: right;
}

.pilot-rating-panel {
  display: grid;
  margin-bottom: 12px;
  align-items: center;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.pilot-rating-panel[hidden] {
  display: none;
}

.pilot-rating-panel > span {
  color: var(--text-secondary);
  font-size: 13px;
}

.pilot-rating {
  display: flex;
}

.pilot-rating button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-right: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
}

.pilot-rating button:last-child {
  border-right: 1px solid var(--line);
}

.pilot-rating button:hover,
.pilot-rating button:focus-visible,
.pilot-rating button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.pilot-outcome-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.pilot-outcome-actions .pilot-action + .pilot-action {
  border-left: 0;
}

.pilot-outcome-actions .pilot-action:last-child {
  grid-column: 1 / -1;
  border-top: 0;
  border-left: 1px solid var(--line);
}

.immersive-frame {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
}

.viewport-panel {
  position: relative;
  min-width: 0;
  min-height: 620px;
  border-right: 1px solid var(--line);
  background: #030508;
}

.first-person-view {
  display: block;
  width: 100%;
  height: 620px;
  background: #030508;
  cursor: crosshair;
  outline: none;
}

.first-person-view:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.viewport-topline,
.viewport-coordinates,
.viewport-status {
  position: absolute;
  z-index: 2;
  display: flex;
  color: rgba(194, 207, 224, 0.72);
  font-size: 13px;
  letter-spacing: 0.1em;
  pointer-events: none;
}

.viewport-topline {
  top: 18px;
  right: 20px;
  left: 20px;
  justify-content: space-between;
}

.viewport-status {
  top: 48px;
  left: 20px;
  align-items: center;
  gap: 8px;
}

.viewport-status.complete {
  color: var(--accent);
}

#fp-status-dot[data-state="ready"],
#fp-status-dot[data-state="paused"] {
  background: var(--text-muted);
  box-shadow: none;
}

#fp-status-dot[data-state="complete"] {
  background: var(--accent);
}

.viewport-coordinates {
  right: 20px;
  bottom: 18px;
  gap: 16px;
}

.viewport-coordinates strong {
  color: var(--text);
  font-weight: 400;
}

.fp-console {
  display: flex;
  padding: 24px;
  flex-direction: column;
  gap: 30px;
  background:
    linear-gradient(180deg, rgba(18, 25, 36, 0.72), rgba(8, 11, 17, 0.92)),
    var(--surface);
}

.session-actions {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
}

.console-action {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-right: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.console-action:nth-child(2),
.console-action:nth-child(3) {
  border-right: 1px solid var(--line);
}

.console-action:nth-child(3) {
  grid-column: 1 / -1;
  border-top: 0;
}

.console-action:hover,
.console-action:focus-visible {
  border-color: rgba(98, 239, 161, 0.55);
  color: var(--accent);
  outline: none;
}

.console-action.primary {
  border-color: rgba(98, 239, 161, 0.48);
  background: var(--accent-soft);
  color: var(--accent);
}

.console-action:disabled {
  cursor: default;
  opacity: 0.58;
}

.live-metrics {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: 1fr 1fr;
}

.live-metrics div {
  min-height: 82px;
  padding: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.live-metrics span,
.live-metrics strong {
  display: block;
}

.live-metrics span {
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.live-metrics strong {
  margin-top: 8px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
}

.key-map {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, 1fr);
}

.key-map > span {
  display: grid;
  min-height: 54px;
  padding: 7px;
  align-content: center;
  border: 1px solid var(--line);
  text-align: center;
}

kbd {
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.key-map small {
  color: var(--text-muted);
  font-size: 13px;
}

.touch-controls {
  display: none;
  grid-template-columns: repeat(3, 1fr);
}

.touch-controls button {
  min-height: 52px;
  border: 1px solid var(--line);
  background: rgba(98, 239, 161, 0.035);
  color: var(--text-secondary);
  touch-action: none;
}

.touch-controls button:active,
.touch-controls button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.privacy-note {
  margin: auto 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

body.pilot-focus .hero,
body.pilot-focus #prototype,
body.pilot-focus #trace-analyzer,
body.pilot-focus .method,
body.pilot-focus .research-contract,
body.pilot-focus .next-build,
body.pilot-focus .site-footer {
  display: none;
}

body.pilot-focus .immersive {
  padding-top: 120px;
}

.live-trace {
  fill: none;
  stroke: #e7b56e;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(231, 181, 110, 0.45));
}

.live-agent {
  fill: #e7b56e;
  stroke: var(--bg);
  stroke-width: 1;
}

.analyzer-toolbar {
  display: grid;
  min-height: 82px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 14, 21, 0.88);
  grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1fr) auto;
}

#analyzer-files {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.analyzer-import {
  display: flex;
  padding: 0 22px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.analyzer-import small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0;
}

.analyzer-import:hover,
.analyzer-import:focus-within {
  background: rgba(98, 239, 161, 0.18);
}

.analyzer-task-list {
  display: flex;
  min-width: 0;
  padding: 12px;
  align-items: stretch;
  gap: 6px;
}

.analyzer-task-button,
.analyzer-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.analyzer-task-button {
  min-width: 104px;
  padding: 0 12px;
}

.analyzer-task-button:hover,
.analyzer-task-button:focus-visible,
.analyzer-task-button[aria-pressed="true"],
.analyzer-actions button:hover:not(:disabled),
.analyzer-actions button:focus-visible:not(:disabled) {
  border-color: rgba(98, 239, 161, 0.5);
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.analyzer-actions {
  display: grid;
  min-width: 210px;
  padding: 12px;
  border-left: 1px solid var(--line);
  grid-template-columns: 0.65fr 1fr;
}

.analyzer-actions button + button {
  border-left: 0;
}

.analyzer-actions button:disabled {
  cursor: default;
  opacity: 0.4;
}

.analyzer-status-row {
  display: flex;
  min-height: 40px;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.analyzer-status-row [data-state="error"] {
  color: var(--warning);
}

.analyzer-status-row [data-state="ready"] {
  color: var(--accent);
}

.analyzer-frame {
  display: grid;
  overflow: hidden;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  background: var(--surface);
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
}

.analyzer-map-panel {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.analyzer-canvas-wrap {
  position: relative;
}

.analyzer-floorplan {
  min-height: 520px;
}

.analyzer-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  background: rgba(6, 8, 12, 0.58);
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  pointer-events: none;
}

.analyzer-empty small {
  max-width: 360px;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0;
  text-align: center;
}

.analyzer-empty[hidden] {
  display: none;
}

.legend-line.analysis-route {
  border-top: 2px solid #72b7ff;
  box-shadow: 0 3px 0 rgba(231, 181, 110, 0.75);
}

.legend-heat,
.legend-hesitation,
.legend-divergence {
  width: 9px;
  height: 9px;
  border: 1px solid var(--accent);
}

.legend-heat {
  background: rgba(98, 239, 161, 0.3);
}

.legend-hesitation {
  border-radius: 50%;
  border-color: var(--warning);
}

.legend-divergence {
  transform: rotate(45deg);
  border-color: #72b7ff;
}

.analysis-heat-cell {
  fill: var(--accent);
  stroke: rgba(98, 239, 161, 0.34);
  stroke-width: 1;
}

.participant-route {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  opacity: 0.78;
}

.route-tone-0 { stroke: #72b7ff; }
.route-tone-1 { stroke: #e7b56e; }
.route-tone-2 { stroke: #eb7ca6; }
.route-tone-3 { stroke: #b3a3ff; }
.route-tone-4 { stroke: #67d8d1; }
.route-tone-5 { stroke: #d4de72; }

.analysis-hesitation-mark {
  fill: rgba(231, 181, 110, 0.12);
  stroke: var(--warning);
  stroke-width: 2;
  stroke-dasharray: 3 3;
}

.analysis-divergence-mark {
  fill: rgba(114, 183, 255, 0.14);
  stroke: #72b7ff;
  stroke-width: 2;
}

.analysis-marker-label {
  fill: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.analyzer-console {
  display: flex;
  padding: 24px;
  flex-direction: column;
  gap: 30px;
  background: linear-gradient(180deg, rgba(18, 25, 36, 0.72), rgba(8, 11, 17, 0.92));
}

.analysis-metrics {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(2, 1fr);
}

.analysis-metrics div {
  min-width: 0;
  min-height: 108px;
  padding: 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.analysis-metrics span,
.analysis-metrics strong,
.analysis-metrics small {
  display: block;
}

.analysis-metrics span,
.analysis-metrics small {
  color: var(--text-muted);
  font-size: 13px;
}

.analysis-metrics strong {
  margin: 11px 0 8px;
  overflow: hidden;
  color: var(--accent);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 400;
  text-overflow: ellipsis;
}

.finding-list {
  margin: 0;
  padding: 0;
  color: var(--text-secondary);
  font-size: 13px;
  list-style: none;
}

.finding-list li {
  display: flex;
  min-height: 38px;
  padding: 8px 0;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.finding-list small {
  color: var(--text-muted);
  white-space: nowrap;
}

.session-table-wrap {
  overflow-x: auto;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.session-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: left;
}

.session-table th,
.session-table td {
  height: 44px;
  padding: 0 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}

.session-table th:last-child,
.session-table td:last-child {
  border-right: 0;
}

.session-table tbody tr:last-child td {
  border-bottom: 0;
}

.session-table th {
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.session-table td:first-child {
  color: var(--text);
}

.method-flow {
  display: grid;
  margin: 52px 0 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
  grid-template-columns: repeat(4, 1fr);
}

.method-flow li {
  position: relative;
  min-height: 250px;
  padding: 28px 24px;
  border-right: 1px solid var(--line);
}

.method-flow li:last-child {
  border-right: 0;
}

.method-flow li > span {
  color: var(--accent);
  font-size: 13px;
}

.method-flow h3 {
  margin: 58px 0 12px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 400;
}

.method-flow p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.75;
}

.research-contract h2 {
  max-width: 880px;
  margin-top: 22px;
}

.contract-grid {
  display: grid;
  margin-top: 64px;
  border: 1px solid var(--line-strong);
  grid-template-columns: 1fr 1fr;
}

.contract-grid article {
  min-height: 290px;
  padding: 32px;
  border-right: 1px solid var(--line);
}

.contract-grid article:last-child {
  border-right: 0;
}

.contract-state {
  font-size: 13px;
  letter-spacing: 0.12em;
}

.contract-state.positive {
  color: var(--accent);
}

.contract-state.caution {
  color: var(--warning);
}

.contract-grid ul {
  margin: 56px 0 0;
  padding: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.8;
  list-style: none;
}

.contract-grid li {
  position: relative;
  padding: 10px 0 10px 18px;
  border-bottom: 1px solid var(--line);
}

.contract-grid li::before {
  position: absolute;
  left: 0;
  content: "—";
  color: var(--text-muted);
}

.next-build {
  display: grid;
  align-items: end;
  grid-template-columns: 1fr minmax(300px, 0.52fr);
  gap: 56px;
}

.next-build > p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.next-sequence {
  display: flex;
  margin-top: 44px;
  align-items: center;
  gap: 14px;
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.next-sequence span {
  padding: 8px 11px;
  border: 1px solid var(--line);
}

.next-sequence .complete {
  border-color: rgba(98, 239, 161, 0.45);
  color: var(--accent);
}

.next-sequence i {
  color: var(--text-muted);
  font-style: normal;
}

.site-footer {
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.1em;
}

@media (max-width: 980px) {
  :root {
    --shell: calc(100vw - 48px);
  }

  .site-header {
    padding-inline: 24px;
  }

  .mode-gate {
    padding-block: 30px 40px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 640px;
    padding-top: 40px;
    grid-column: 1;
  }

  .simulation-frame {
    grid-template-columns: 1fr;
  }

  .pilot-protocol {
    grid-template-columns: 1fr 1fr;
  }

  .pilot-protocol > div:nth-child(2) {
    border-right: 0;
  }

  .pilot-protocol > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .immersive-frame,
  .analyzer-frame {
    grid-template-columns: 1fr;
  }

  .map-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .viewport-panel {
    min-height: 520px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .analyzer-map-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .analyzer-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .analyzer-task-list {
    order: 3;
    grid-column: 1 / -1;
  }

  .first-person-view {
    height: 520px;
  }

  .metric-grid,
  .method-flow {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-card:nth-child(2),
  .method-flow li:nth-child(2) {
    border-right: 0;
  }

  .metric-card:nth-child(-n + 2),
  .method-flow li:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  :root {
    --shell: calc(100vw - 32px);
  }

  .site-header {
    min-height: 58px;
    padding-inline: 16px;
  }

  .participant-header {
    padding-inline: 16px;
  }

  .mode-gate {
    min-height: 100svh;
    padding-block: 24px 30px;
    gap: 28px;
  }

  .mode-gate-copy h2 {
    margin-top: 18px;
    font-size: clamp(42px, 15vw, 68px);
  }

  .mode-gate-options {
    grid-template-columns: 1fr;
  }

  .mode-gate-options button {
    min-height: 180px;
    padding: 20px;
  }

  .wordmark-module,
  .system-state span:first-child {
    display: none;
  }

  .system-state {
    gap: 0;
  }

  .hero {
    min-height: calc(100svh - 58px);
    padding-block: 82px 56px;
  }

  .hero h1 {
    margin-top: 24px;
    font-size: clamp(39px, 12.6vw, 62px);
    line-height: 1.02;
  }

  .hero-copy {
    padding-top: 30px;
    font-size: 13px;
  }

  .hero-actions {
    margin-top: 38px;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .prototype,
  .immersive,
  .trace-analyzer,
  .method,
  .research-contract,
  .next-build {
    padding-block: 80px;
  }

  .section-heading,
  .next-build {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .section-heading h2,
  .research-contract h2,
  .next-build h2 {
    font-size: 36px;
  }

  .map-toolbar {
    padding-block: 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .map-legend {
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  .floorplan {
    min-height: 310px;
  }

  .viewport-panel {
    min-height: 420px;
  }

  .first-person-view {
    height: 420px;
  }

  .viewport-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .viewport-status {
    top: 66px;
  }

  .fp-console {
    padding: 18px;
  }

  .pilot-protocol {
    grid-template-columns: 1fr;
  }

  .pilot-protocol > div,
  .pilot-protocol > div:nth-child(2) {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pilot-protocol > div:last-child {
    border-bottom: 0;
  }

  .analyzer-toolbar {
    grid-template-columns: 1fr;
  }

  .analyzer-import,
  .analyzer-actions {
    min-height: 70px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .analyzer-task-list {
    order: initial;
    overflow-x: auto;
    grid-column: auto;
  }

  .analyzer-status-row {
    padding-block: 10px;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .analyzer-floorplan {
    min-height: 310px;
  }

  .analyzer-console {
    padding: 18px;
  }

  .key-map {
    display: none;
  }

  .touch-controls {
    display: grid;
  }

  .map-caption span:first-child {
    display: none;
  }

  .map-caption {
    justify-content: flex-end;
  }

  .control-panel {
    padding: 18px;
  }

  .metric-grid,
  .method-flow,
  .contract-grid {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .metric-card:nth-child(2),
  .method-flow li,
  .method-flow li:nth-child(2),
  .contract-grid article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-card:last-child,
  .method-flow li:last-child,
  .contract-grid article:last-child {
    border-bottom: 0;
  }

  .method-flow li {
    min-height: 210px;
  }

  .contract-grid article {
    min-height: auto;
  }

  .next-sequence {
    align-items: flex-start;
    flex-direction: column;
  }

  .next-sequence i {
    transform: rotate(90deg);
  }

  .site-footer {
    padding-block: 24px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
