:root {
  --forest: #1b4d3e;
  --forest-deep: #0f2e25;
  --forest-soft: #eaf1ec;
  --gold: #c9a96e;
  --gold-soft: #f1eadc;
  --paper: #faf9f5;
  --surface: #ffffff;
  --line: #ded8cb;
  --ink: #171717;
  --muted: #62665f;
  --soft: #eef2ee;
  --amber: #b8791f;
  --red: #8b2818;
  --blue: #365f77;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top right, rgba(27, 77, 62, 0.11), transparent 34rem),
    radial-gradient(circle at 12% 18%, rgba(201, 169, 110, 0.18), transparent 26rem),
    var(--paper);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 300;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid rgba(222, 216, 203, 0.72);
  display: flex;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 72px);
}

.brand,
.topnav a,
.eyebrow,
.card-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand,
.eyebrow,
.card-label {
  color: var(--forest);
}

.topnav {
  display: flex;
  gap: 24px;
}

.topnav a {
  color: var(--muted);
}

.topnav a:hover {
  color: var(--forest);
}

main {
  padding: 54px clamp(20px, 5vw, 72px) 86px;
}

.hero,
.console,
.output-section,
.architecture,
.code-section {
  margin: 0 auto;
  max-width: 1440px;
}

.hero {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.46fr);
  margin-bottom: 34px;
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  line-height: 1.05;
}

h1 {
  font-size: clamp(54px, 7vw, 104px);
  max-width: 900px;
}

.summary {
  color: #343833;
  font-size: clamp(18px, 2vw, 22px);
  margin-top: 24px;
  max-width: 780px;
}

.hero-card,
.prompt-panel,
.run-panel,
.monitor-panel,
.brief-card,
.json-card,
.architecture,
.code-section {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(15, 46, 37, 0.06);
}

.hero-card {
  align-self: end;
  padding: 28px;
}

.hero-card h2 {
  font-size: 32px;
  margin: 10px 0 14px;
}

.hero-card p:last-child {
  color: var(--muted);
  font-size: 15px;
}

.console {
  display: grid;
  gap: 18px;
  grid-template-columns: 350px minmax(440px, 1fr) 340px;
}

.prompt-panel,
.run-panel,
.monitor-panel {
  min-height: 740px;
  padding: 24px;
}

.panel-heading {
  margin-bottom: 20px;
}

.panel-heading h2,
.run-header h2,
.review-card h2 {
  font-size: 34px;
}

.compact {
  margin-bottom: 14px;
}

.scenario-list {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.scenario {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 11px 14px;
  text-align: left;
}

.scenario.is-active {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  color: #fff;
}

.field-label,
.controls-grid span {
  color: var(--forest-deep);
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

textarea,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  outline: none;
  width: 100%;
}

textarea {
  min-height: 178px;
  padding: 16px;
  resize: vertical;
}

select {
  min-height: 44px;
  padding: 0 12px;
}

textarea:focus,
select:focus {
  border-color: rgba(27, 77, 62, 0.5);
  box-shadow: 0 0 0 4px rgba(27, 77, 62, 0.08);
}

.controls-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.run-button,
.output-actions button {
  background: var(--forest);
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  min-height: 48px;
  padding: 0 18px;
  text-transform: uppercase;
}

.run-button {
  width: 100%;
}

.run-button:disabled {
  background: #9ca89f;
  cursor: wait;
}

.contract-card,
.detail-card,
.review-card {
  background: rgba(250, 249, 245, 0.74);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 18px;
  padding: 18px;
}

pre,
code {
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
}

.contract-card pre {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin-top: 10px;
  white-space: pre-wrap;
}

.run-header {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.run-state {
  background: var(--gold-soft);
  border: 1px solid rgba(201, 169, 110, 0.56);
  border-radius: 999px;
  color: #6f5520;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 9px 12px;
  text-transform: uppercase;
  white-space: nowrap;
}

.run-state.running {
  background: var(--forest-soft);
  border-color: rgba(27, 77, 62, 0.26);
  color: var(--forest);
}

.run-state.complete {
  background: #e5efdf;
  border-color: rgba(74, 107, 58, 0.28);
  color: #3d5f2d;
}

.progress-shell {
  background: #ece7dc;
  border-radius: 999px;
  height: 8px;
  margin-bottom: 18px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--forest), var(--gold));
  height: 100%;
  transition: width 260ms ease;
  width: 0%;
}

.timeline {
  display: grid;
  gap: 12px;
}

.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: 42px 1fr auto;
  padding: 14px;
  text-align: left;
  width: 100%;
}

.step:hover,
.step.is-selected {
  border-color: rgba(27, 77, 62, 0.34);
}

.step-index {
  align-items: center;
  background: var(--soft);
  border-radius: 50%;
  color: var(--forest);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.step h3 {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 3px;
}

.step p {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  height: fit-content;
  letter-spacing: 0.08em;
  padding: 7px 9px;
  text-transform: uppercase;
}

.queued {
  background: #f0eee7;
  color: #777166;
}

.running {
  background: var(--forest-soft);
  color: var(--forest);
}

.complete {
  background: #e5efdf;
  color: #42652f;
}

.warning {
  background: #f5ead7;
  color: var(--amber);
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}

.metric span {
  color: var(--forest-deep);
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 42px;
  line-height: 1;
}

.metric p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-top: 8px;
  text-transform: uppercase;
}

.detail-card h3 {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  margin: 10px 0;
}

.detail-card p {
  color: var(--muted);
  font-size: 14px;
}

#reviewQueue {
  display: grid;
  gap: 10px;
  list-style: none;
}

#reviewQueue li {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
}

#reviewQueue li.empty {
  border-left-color: var(--line);
}

.output-section,
.architecture,
.code-section {
  margin-top: 22px;
  padding: 28px;
}

.section-head {
  align-items: end;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: clamp(34px, 4vw, 56px);
}

.section-copy {
  color: var(--muted);
  max-width: 620px;
}

.output-actions {
  display: flex;
  gap: 10px;
}

.output-actions button:nth-child(2) {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--forest);
}

.output-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 0.58fr) minmax(420px, 1fr);
}

.brief-card,
.json-card {
  box-shadow: none;
  min-height: 250px;
  padding: 22px;
}

.brief-card h3 {
  font-size: 34px;
  margin: 14px 0;
}

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

.brief-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.brief-tags span {
  background: var(--forest-soft);
  border-radius: 999px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
}

.json-card pre,
.code-block {
  background: #121817;
  border-radius: 12px;
  color: #e8ece4;
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
  padding: 18px;
  white-space: pre;
}

.architecture-flow {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto 1fr auto 1.1fr auto 1fr auto 1fr;
}

.node {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  font-weight: 800;
  justify-content: center;
  min-height: 118px;
  padding: 16px;
  text-align: center;
}

.node span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-top: 5px;
}

.node-strong {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  color: #fff;
}

.node-strong span {
  color: rgba(255, 255, 255, 0.72);
}

.arrow {
  align-items: center;
  color: var(--gold);
  display: flex;
  font-size: 24px;
  justify-content: center;
}

@media (max-width: 1180px) {
  .console,
  .hero,
  .output-grid,
  .section-head {
    grid-template-columns: 1fr;
  }

  .prompt-panel,
  .run-panel,
  .monitor-panel {
    min-height: auto;
  }

  .architecture-flow {
    grid-template-columns: 1fr;
  }

  .arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 720px) {
  .topbar,
  .topnav,
  .output-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    padding-top: 34px;
  }

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

  .step {
    grid-template-columns: 36px 1fr;
  }

  .status-pill {
    grid-column: 2;
    width: fit-content;
  }
}
