:root {
  color-scheme: light;
  --forge-ink: #101611;
  --forge-paper: #f3f1e7;
  --forge-panel: #fffdf5;
  --forge-line: #a7aa9e;
  --forge-soft-line: #d6d5ca;
  --forge-green: #b7f06b;
  --forge-teal: #3ecdb6;
  --forge-apricot: #ffcb69;
  --forge-coral: #ff806b;
  --forge-blue: #92b7ff;
  --forge-dark: #111a16;
  --forge-muted: #5c625d;
  --forge-shadow: 0 18px 55px rgb(18 26 22 / 12%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--forge-paper);
  color: var(--forge-ink);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 3%, rgb(183 240 107 / 24%), transparent 27rem),
    radial-gradient(circle at 93% 12%, rgb(62 205 182 / 18%), transparent 30rem),
    var(--forge-paper);
  color: var(--forge-ink);
}
button,
textarea,
input {
  font: inherit;
}
button {
  min-height: 44px;
  border: 1px solid var(--forge-ink);
  border-radius: 5px;
  padding: 0.68rem 0.9rem;
  background: var(--forge-panel);
  color: var(--forge-ink);
  font-weight: 750;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--forge-ink);
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid #006a5b;
  outline-offset: 3px;
}
.button-primary {
  background: var(--forge-green);
  color: #101611;
}
.button-secondary {
  background: transparent;
}
.forge-shell {
  width: min(100%, 1540px);
  margin: 0 auto;
  overflow: clip;
}
.forge-topbar {
  margin: 0.9rem clamp(0.75rem, 2vw, 2rem) 0;
}
.forge-focus {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem 1rem;
  align-items: center;
  margin: 0.9rem clamp(0.75rem, 2vw, 2rem) 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--forge-ink);
  background: var(--forge-apricot);
  box-shadow: 4px 4px 0 var(--forge-ink);
}
.forge-focus span,
.forge-kicker,
.panel-heading > span,
.world-stage__toolbar span,
.decision-panel > span,
.inspiration-strip > span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.forge-focus strong {
  font-size: 0.92rem;
}
.forge-focus p {
  margin: 0;
  color: #313831;
  font-size: 0.79rem;
}
.forge-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 0.55fr);
  gap: clamp(1.4rem, 4vw, 4.2rem);
  align-items: end;
  padding: clamp(3.3rem, 7vw, 7.2rem) clamp(1rem, 4.5vw, 5.3rem) clamp(2.4rem, 5vw, 4.4rem);
}
.forge-kicker {
  margin: 0 0 0.75rem;
  color: #216c60;
}
.forge-hero h1 {
  max-width: 920px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7.4vw, 7.2rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.9;
}
.forge-hero__copy > p:not(.forge-kicker) {
  max-width: 780px;
  margin: 1.4rem 0 0;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  line-height: 1.52;
}
.forge-source-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.5rem;
}
.forge-source-notes span {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--forge-line);
  border-radius: 4px;
  background: rgb(255 253 245 / 72%);
  font-size: 0.75rem;
}
.forge-hero__receipt {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--forge-ink);
  background: var(--forge-dark);
  color: #f5f5ed;
  box-shadow: 8px 8px 0 var(--forge-teal);
}
.forge-hero__receipt span {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--forge-green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.forge-hero__receipt strong {
  display: block;
  max-width: 18rem;
  font-size: 1.4rem;
  line-height: 1.15;
}
.forge-hero__receipt p {
  margin: 0.75rem 0 1rem;
  color: #cdd4cf;
}
.forge-hero__receipt a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: #f5f5ed;
  font-weight: 750;
  text-underline-offset: 0.24rem;
}
.forge-command {
  margin: 0 clamp(0.75rem, 2vw, 2rem) clamp(4rem, 7vw, 7rem);
  padding: clamp(1rem, 2.5vw, 2rem);
  border: 1px solid var(--forge-ink);
  border-radius: 7px;
  background: var(--forge-panel);
  box-shadow: var(--forge-shadow);
}
.forge-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.forge-presets button {
  background: transparent;
  font-size: 0.82rem;
}
.forge-presets button[aria-pressed="true"] {
  background: var(--forge-ink);
  color: #fff;
  box-shadow: 3px 3px 0 var(--forge-teal);
}
.mission-field {
  display: grid;
  gap: 0.5rem;
}
.mission-field > span,
.autonomy-field > span {
  font-size: 0.8rem;
  font-weight: 800;
}
.mission-field textarea {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  border: 1px solid var(--forge-ink);
  border-radius: 4px;
  padding: 0.85rem;
  background: #fff;
  color: var(--forge-ink);
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  line-height: 1.46;
}
.forge-command__footer {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) auto;
  gap: 1rem 2rem;
  align-items: end;
  margin-top: 1rem;
}
.autonomy-field {
  display: grid;
  gap: 0.3rem;
}
.autonomy-field > span {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.autonomy-field output {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.autonomy-field input {
  min-height: 44px;
  accent-color: #157a68;
}
.autonomy-field small {
  color: var(--forge-muted);
}
.forge-command__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}
.forge-command__actions button {
  white-space: nowrap;
}
.forge-status {
  min-height: 1.4rem;
  margin: 0.85rem 0 0;
  color: var(--forge-muted);
  font-size: 0.82rem;
}
.world-section,
.agents-section,
.proof-section {
  padding: clamp(3rem, 6vw, 6rem) clamp(0.75rem, 2vw, 2rem);
}
.world-section {
  background: var(--forge-dark);
  color: #f6f6ee;
}
.world-heading,
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.4rem;
}
.world-heading h2,
.section-heading h2 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 5vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.96;
}
.world-heading p:not(.forge-kicker),
.section-heading > p:not(.forge-kicker) {
  max-width: 680px;
  margin: 0.75rem 0 0;
  color: #bdc8c1;
  line-height: 1.5;
}
.section-heading > p:not(.forge-kicker) {
  color: var(--forge-muted);
}
.world-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}
.world-controls button:not(.button-primary) {
  border-color: #7d8d84;
  background: transparent;
  color: #fff;
}
.world-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(19rem, 0.55fr);
  gap: 1rem;
}
.world-stage,
.metric-panel,
.hazard-panel,
.decision-panel {
  border: 1px solid #526159;
  border-radius: 7px;
  background: #17231e;
}
.world-stage {
  min-width: 0;
  overflow: hidden;
}
.world-stage__toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #526159;
}
.world-stage__toolbar div {
  display: grid;
  gap: 0.3rem;
}
.world-stage__toolbar span {
  color: var(--forge-teal);
}
.world-stage__toolbar strong {
  max-width: 680px;
  line-height: 1.35;
}
#forge-world {
  display: block;
  width: 100%;
  min-height: 480px;
  background: #101914;
}
.world-grid {
  fill: url(#forge-grid);
}
#forge-grid path {
  fill: none;
  stroke: #26342d;
  stroke-width: 1;
}
#forge-arrow path {
  fill: #6e7d75;
}
.lane-marker rect {
  fill: #1c2923;
  stroke: #45554c;
}
.lane-marker text,
.world-link text {
  fill: #aebcb4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
}
.world-link path {
  fill: none;
  stroke: #6e7d75;
  stroke-width: 2;
  stroke-dasharray: 4 5;
}
.flow-pip {
  fill: var(--forge-green);
  filter: drop-shadow(0 0 6px rgb(183 240 107 / 75%));
}
.world-agent__body {
  fill: #1e2d26;
  stroke: var(--agent-accent);
  stroke-width: 2;
}
.world-agent__signal {
  fill: var(--agent-accent);
}
.world-agent__label {
  fill: #f8f8f0;
  font-size: 13px;
  font-weight: 800;
}
.world-agent__output {
  fill: #b9c5be;
  font-size: 9px;
}
.world-agent__status {
  fill: var(--agent-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  text-transform: uppercase;
}
.world-agent--faulted .world-agent__body {
  stroke: var(--forge-coral);
  stroke-width: 5;
  stroke-dasharray: 8 4;
}
.world-ops {
  display: grid;
  gap: 1rem;
  align-content: start;
}
.metric-panel,
.hazard-panel,
.decision-panel {
  padding: 1rem;
}
.panel-heading span,
.decision-panel > span {
  color: #1c7062;
}
.world-heading .forge-kicker,
.world-section .panel-heading span,
.world-section .decision-panel > span {
  color: var(--forge-teal);
}
.panel-heading h3,
.decision-panel h3 {
  margin: 0.35rem 0 0;
  font-size: 1.02rem;
}
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}
.metric-grid article {
  position: relative;
  min-height: 86px;
  overflow: hidden;
  padding: 0.65rem;
  border: 1px solid #45554c;
  border-radius: 4px;
  background: #101914;
}
.metric-grid span,
.metric-grid strong {
  position: relative;
  z-index: 1;
  display: block;
}
.metric-grid span {
  color: #aebbb4;
  font-size: 0.7rem;
}
.metric-grid strong {
  margin-top: 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.35rem;
}
.metric-grid i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: var(--metric-value, 0%);
  height: 5px;
  background: var(--forge-green);
  transition: width 220ms ease;
}
.hazard-controls {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}
.hazard-controls button {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  text-align: left;
  border-color: #708078;
  background: #111a16;
  color: #fff;
}
.hazard-controls button:hover:not(:disabled) {
  background: #3b201c;
  box-shadow: 3px 3px 0 var(--forge-coral);
}
.hazard-controls small {
  color: #aebbb4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.decision-panel p {
  margin: 0.75rem 0 0;
  color: #c6d0ca;
  line-height: 1.5;
}
.agents-section {
  background: #dbe7de;
}
.agent-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}
.agent-card {
  position: relative;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--forge-ink);
  border-top: 6px solid var(--agent-accent);
  border-radius: 5px;
  background: var(--forge-panel);
  box-shadow: 4px 4px 0 rgb(16 22 17 / 16%);
}
.agent-card > div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--forge-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.64rem;
  text-transform: uppercase;
}
.agent-card h3 {
  margin: 1.3rem 0 0.55rem;
  font-size: 1.05rem;
}
.agent-card p {
  margin: 0;
  color: #353c36;
  font-size: 0.83rem;
  line-height: 1.45;
}
.agent-card small {
  display: block;
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--forge-soft-line);
  color: #39423c;
  line-height: 1.35;
}
.proof-section {
  background: var(--forge-paper);
}
.proof-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(16rem, 0.58fr);
  gap: 1rem;
}
.trace-panel,
.blueprint-panel,
.automation-panel {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--forge-ink);
  border-radius: 6px;
  background: var(--forge-panel);
}
.causal-trace {
  display: grid;
  gap: 0;
  max-height: 29rem;
  overflow: auto;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.causal-trace li {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--forge-soft-line);
}
.causal-trace li > span {
  color: var(--forge-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}
.causal-trace p {
  margin: 0.18rem 0 0;
  color: #454d47;
  font-size: 0.8rem;
  line-height: 1.4;
}
.blueprint-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.blueprint-lists strong {
  display: block;
  font-size: 0.8rem;
}
.blueprint-lists ol,
.blueprint-lists ul {
  margin: 0.55rem 0 0;
  padding-left: 1.15rem;
  color: #3f4741;
  font-size: 0.8rem;
  line-height: 1.5;
}
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.4rem;
}
.automation-panel {
  background: var(--forge-dark);
  color: #fff;
}
.automation-panel .panel-heading span {
  color: var(--forge-teal);
}
.automation-panel pre {
  max-width: 100%;
  overflow: auto;
  margin: 1rem 0;
  padding: 0.8rem;
  border: 1px solid #4a5a51;
  border-radius: 4px;
  background: #0a100d;
  color: var(--forge-green);
  font: 0.72rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.inspiration-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin: 0 clamp(0.75rem, 2vw, 2rem) 3rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--forge-ink);
  background: var(--forge-apricot);
}
.inspiration-strip p {
  margin: 0;
  font-size: 0.82rem;
}
.inspiration-strip a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--forge-ink);
  font-weight: 800;
  text-underline-offset: 0.22rem;
}
.site-footer {
  margin: 0 clamp(0.75rem, 2vw, 2rem) 1rem;
}
.site-footer a {
  min-height: 44px !important;
}
@media (max-width: 1120px) {
  .forge-hero,
  .world-layout,
  .proof-layout {
    grid-template-columns: 1fr;
  }
  .forge-hero__receipt {
    max-width: 32rem;
  }
  .world-ops {
    grid-template-columns: 1fr 1fr;
  }
  .decision-panel {
    grid-column: 1 / -1;
  }
  .agent-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .forge-focus,
  .inspiration-strip {
    grid-template-columns: 1fr;
  }
  .forge-focus p {
    display: none;
  }
  .forge-hero {
    padding-top: 3.2rem;
  }
  .forge-hero h1 {
    font-size: clamp(2.8rem, 15vw, 5rem);
  }
  .forge-command__footer,
  .world-ops,
  .blueprint-lists {
    grid-template-columns: 1fr;
  }
  .forge-command__actions,
  .world-controls {
    justify-content: stretch;
  }
  .forge-command__actions button,
  .world-controls button,
  .export-actions button {
    flex: 1 1 11rem;
  }
  .world-heading,
  .section-heading {
    display: grid;
    align-items: start;
  }
  .decision-panel {
    grid-column: auto;
  }
  #forge-world {
    min-height: 390px;
  }
  .agent-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .forge-topbar,
  .forge-focus,
  .forge-command,
  .inspiration-strip,
  .site-footer {
    margin-right: 0.6rem;
    margin-left: 0.6rem;
  }
  .forge-hero,
  .world-section,
  .agents-section,
  .proof-section {
    padding-right: 0.6rem;
    padding-left: 0.6rem;
  }
  .forge-source-notes {
    display: grid;
  }
  .forge-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .forge-presets button {
    min-width: 0;
  }
  .world-stage__toolbar {
    grid-template-columns: 1fr;
  }
  #forge-world {
    min-height: 330px;
  }
  .agent-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
