@font-face {
  font-family: "Manrope";
  src: url("/demo/assets/fonts/Manrope-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --panel: #f5f5f5;
  --ink: #000000;
  --muted: #797979;
  --border: #d9d9d9;
  --font-sans: "Manrope", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero,
.content-grid {
  display: grid;
  gap: 16px;
}

.hero {
  grid-template-columns: 1.35fr 0.95fr;
  margin-bottom: 16px;
}

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

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px;
}

.hero-copy {
  padding: 28px;
}

.eyebrow,
.mini-label,
.signal-label,
.status-key {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.76rem;
}

.eyebrow,
.mini-label {
  color: var(--muted);
  margin-bottom: 10px;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  max-width: 14ch;
}

.lead {
  margin: 14px 0 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1px 6px;
  background: var(--bg);
}

.hero-actions,
.prompt-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 22px;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  min-height: 42px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--bg);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.hero-status {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.status-stack {
  display: grid;
  gap: 10px;
}

.status-stack > div {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg);
}

.status-key {
  display: block;
  color: var(--muted);
  margin-bottom: 5px;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.signal-grid article {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg);
}

.signal-label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: clamp(1.4rem, 2.3vw, 2.1rem);
}

.executive-brief,
.operations-panel,
.prompt-panel,
.surface-panel {
  grid-column: span 12;
}

.content-grid > .panel:not(.executive-brief):not(.operations-panel):not(.prompt-panel) {
  grid-column: span 6;
}

.brief-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.brief-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg);
}

.brief-card h3 {
  margin: 0 0 8px;
  font-size: 1.03rem;
}

.brief-card p {
  margin: 0;
  color: var(--muted);
}

.stream-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.stream-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
}

.badge-up {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.badge-down {
  background: var(--bg);
  color: var(--muted);
}

.stream-contract {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.stream-log {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  max-height: 360px;
  overflow: auto;
}

.stream-log li {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.4;
}

.stream-log li:last-child {
  border-bottom: 0;
}

.stack-grid,
.card-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-card,
.scenario-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--bg);
}

.stack-card h3,
.scenario-card h3 {
  margin: 0 0 8px;
}

.stack-card p,
.scenario-card p {
  margin: 0 0 8px;
  color: var(--muted);
}

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

.split-list {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split-list article h3 {
  margin: 0 0 10px;
}

ol,
ul.simple-list,
ul.alert-list {
  margin: 0;
  padding-left: 20px;
}

ol li,
ul.simple-list li,
ul.alert-list li {
  margin-bottom: 8px;
  color: var(--muted);
}

.alert-list .alert-item {
  margin-bottom: 10px;
}

.alert-item strong {
  color: var(--ink);
}

.alert-item p {
  margin: 6px 0 0;
}

.prompt-form input[type="text"] {
  flex: 1;
  min-width: 240px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 14px;
  font: inherit;
  background: var(--bg);
  color: var(--ink);
}

.prompt-form input[type="text"]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.prompt-output {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  min-height: 86px;
  padding: 12px;
  white-space: pre-wrap;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .content-grid > .panel:not(.executive-brief):not(.operations-panel):not(.prompt-panel) {
    grid-column: span 12;
  }

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

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

@media (max-width: 640px) {
  .page-shell {
    width: calc(100% - 20px);
    padding: 14px 0 24px;
  }

  .panel,
  .hero-copy {
    padding: 16px;
  }

  .hero-actions,
  .prompt-form {
    flex-direction: column;
  }

  .btn,
  .prompt-form input[type="text"] {
    width: 100%;
  }
}
