:root {
  color-scheme: light;
  --ink: #1f2924;
  --muted: #68736d;
  --cream: #f7f2e8;
  --paper: #fffdf8;
  --green: #1d6046;
  --green-soft: #dfece4;
  --orange: #df6b3a;
  --orange-soft: #f8e4d7;
  --line: #ded9cf;
  --shadow: 0 18px 45px rgba(31, 41, 36, .10);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; color: var(--ink); background: var(--cream); line-height: 1.55; }
a { color: var(--green); }
button, input { font: inherit; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  padding: 0 5vw;
  background: rgba(255, 253, 248, .92);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.04em;
}

.brand::before {
  content: "";
  display: inline-block;
  width: .7rem;
  height: .7rem;
  margin-right: .6rem;
  border-radius: 50%;
  background: var(--orange);
  vertical-align: .18rem;
}

.topbar-note,
.eyebrow,
.section-label,
.status-label,
.step-index {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

main { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
h1, h2, h3, p { margin-top: 0; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(280px, .72fr);
  gap: 4rem;
  align-items: center;
  padding: 6rem 0 5rem;
}

.eyebrow { margin-bottom: .8rem; color: var(--orange); }

h1 {
  max-width: 780px;
  margin-bottom: 1.4rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 7vw, 6.2rem);
  font-weight: 700;
  line-height: .96;
  letter-spacing: -.055em;
}

.lede { max-width: 700px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.hero-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .75rem 1.1rem;
  border: 1px solid var(--green);
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary, button.secondary { color: var(--green); background: var(--paper); }
.button:hover, button:hover { filter: brightness(.96); transform: translateY(-1px); }
.button:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.contract {
  padding: 1.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.contract h2 { margin: .25rem .35rem 1rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; }
.contract-row { padding: .95rem 1rem; border-radius: 16px; background: var(--cream); font-weight: 760; }
.contract-row::before { content: "✓"; margin-right: .55rem; color: var(--green); font-weight: 900; }
.contract-row + .contract-row { margin-top: .65rem; }
.contract-row:nth-of-type(2) { background: var(--green-soft); }
.contract-row:last-child { color: #fff; background: var(--green); }
.contract-row:last-child::before { color: #fff; }

.demo-shell {
  margin-bottom: 5rem;
  padding: clamp(1.1rem, 3vw, 2.2rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.demo-head { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: end; padding-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.demo-head h2 { margin-bottom: .25rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.1rem, 4vw, 3.5rem); letter-spacing: -.04em; }
.demo-head p { margin-bottom: 0; color: var(--muted); }

.controls { display: grid; grid-template-columns: minmax(180px, 240px) auto auto; gap: .75rem; align-items: end; margin: 1.7rem 0; }
.field { display: grid; gap: .4rem; }
.field label { color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.input-wrap { display: flex; align-items: center; min-height: 48px; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.input-wrap span { color: var(--green); font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 700; }
.input-wrap input { width: 100%; border: 0; outline: 0; padding: .6rem; color: var(--ink); background: transparent; font-weight: 760; }

.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: .55rem; margin: 1.2rem 0 1.4rem; }
.pipeline-step { min-height: 76px; padding: .75rem; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: var(--cream); }
.pipeline-step strong { display: block; margin-top: .25rem; color: inherit; font-size: .9rem; }
.pipeline-step.active { color: var(--ink); border-color: #e5b69d; background: var(--orange-soft); }
.pipeline-step.done { color: var(--ink); border-color: #b9d2c2; background: var(--green-soft); }
.pipeline-step.blocked { color: #683013; border-color: #e5b69d; background: var(--orange-soft); }

.outcome { min-height: 58px; margin: 0 0 1.3rem; padding: .95rem 1.1rem; border-radius: 16px; color: var(--green); background: var(--green-soft); font-weight: 760; }
.outcome.blocked { color: #683013; background: var(--orange-soft); }

.demo-grid { display: grid; grid-template-columns: .92fr 1.08fr; gap: 1.4rem; }
.terminal { min-height: 390px; padding: 1.2rem; border-radius: 22px; color: #ecf4ee; background: #173f31; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.terminal-bar { display: flex; gap: .45rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,.2); }
.terminal-dot { width: .65rem; height: .65rem; border-radius: 50%; background: #f0c670; }
.terminal-dot:nth-child(2) { background: #df6b3a; }
.terminal-dot:nth-child(3) { background: #8fc8a0; }
#log { display: grid; gap: .6rem; margin: 1rem 0 0; padding: 0; list-style: none; font-family: "SFMono-Regular", Consolas, monospace; font-size: .86rem; line-height: 1.45; }
.log-line { display: grid; grid-template-columns: 5.4rem 1fr; gap: .75rem; }
.log-line span:first-child { color: #f5d692; font-weight: 800; }
.log-line.error span:first-child { color: #f0a286; }
.terminal-empty { color: #b7c9c0; }

.result-card { display: grid; align-content: start; gap: 1rem; }
.plan-card, .cart-card, .boundary-card { border: 1px solid var(--line); border-radius: 20px; background: var(--cream); }
.plan-card { padding: 1.1rem; }
.plan-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.chip { padding: .28rem .55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--paper); font-size: .72rem; font-weight: 760; }
.meal { display: grid; grid-template-columns: 3.2rem 1fr; gap: .8rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.meal-day { color: var(--orange); font-size: .74rem; font-weight: 850; text-transform: uppercase; }
.meal strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }
.meal small { color: var(--muted); }
.cart-card { display: grid; grid-template-columns: 1fr auto; gap: .8rem; padding: 1rem; color: #fff; background: var(--green); border-color: var(--green); }
.cart-card strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; }
.cart-card span { color: rgba(255,255,255,.74); font-size: .8rem; }
.cart-total { text-align: right; }
.boundary-card { padding: 1rem; background: var(--orange-soft); border-color: #e5b69d; }
.boundary-card strong { display: block; margin-bottom: .3rem; color: #7e3014; }
.boundary-card p { margin: 0; color: #683013; }

.proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin: 0 0 5rem; }
.proof { padding: 1.4rem; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: 0 10px 28px rgba(31,41,36,.06); }
.proof:nth-child(2) { background: var(--green-soft); }
.proof h3 { margin-bottom: .55rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; }
.proof p { margin-bottom: 0; color: var(--muted); }

footer { padding: 2rem 5vw; color: var(--muted); background: var(--paper); border-top: 1px solid var(--line); }
footer p { max-width: 1160px; margin: 0 auto; }

@media (max-width: 820px) {
  .topbar-note { display: none; }
  .hero { grid-template-columns: 1fr; gap: 2.2rem; padding: 4rem 0 3.5rem; }
  h1 { font-size: clamp(3.2rem, 15vw, 5rem); }
  .demo-head { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr 1fr; }
  .field { grid-column: 1 / -1; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .demo-grid, .proof-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  main { width: calc(100% - 20px); }
  .topbar { padding-inline: 14px; }
  .hero { padding-top: 3.2rem; }
  .hero-links, .controls { display: grid; grid-template-columns: 1fr; }
  .field { grid-column: auto; }
  .button, button { width: 100%; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .log-line { grid-template-columns: 4.8rem 1fr; font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
