:root {
  color-scheme: light;
  --ink: #151311;
  --muted: #70695d;
  --paper: #f8f4ec;
  --panel: #fffdfa;
  --line: rgba(21, 19, 17, .14);
  --hot: #ef4f2f;
  --blue: #274fd8;
  --green: #197052;
  --shadow: 0 26px 80px rgba(36, 30, 18, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(21,19,17,.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(0deg, rgba(21,19,17,.025) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(248,244,236,.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .02em;
}
.brand img { width: 34px; height: 34px; object-fit: contain; }
nav { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 750;
  font-size: 14px;
}
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .7fr);
  align-items: center;
  gap: clamp(24px, 5vw, 70px);
  padding: clamp(52px, 8vw, 108px) 0;
}
.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--blue);
  font-weight: 900;
  font-size: 12px;
}
h1, h2 { margin: 0; line-height: .96; letter-spacing: 0; }
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 9.6vw, 132px);
  max-width: 880px;
}
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 70px);
}
.lead {
  max-width: 660px;
  margin: 24px 0 0;
  color: #3e392f;
  font-size: clamp(18px, 2vw, 24px);
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.button {
  border: 1px solid var(--line);
  min-height: 46px;
  border-radius: 999px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(21,19,17,.14); }
.button.primary { background: var(--ink); color: white; border-color: var(--ink); }
.button.secondary { background: white; }

.hero-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  min-height: 500px;
  padding: clamp(22px, 4vw, 44px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px solid var(--ink);
  pointer-events: none;
}
.meter {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  margin: 24px auto;
  width: min(100%, 300px);
  border: 18px solid var(--hot);
  border-right-color: var(--blue);
  border-bottom-color: var(--green);
  border-radius: 50%;
}
.meter span { color: var(--muted); font-weight: 850; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
.meter strong { display: block; font-size: clamp(68px, 9vw, 112px); line-height: .8; }
.signal-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.signal-grid div {
  min-height: 82px;
  border: 1px solid var(--line);
  padding: 16px;
  background: #fbf4e5;
}
.signal-grid span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 900; }
.signal-grid b { display: block; margin-top: 8px; font-size: 21px; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
  padding: 32px 0 74px;
}
.input-card, .output-card, .evidence, .checks {
  border: 1px solid var(--line);
  background: rgba(255,253,250,.92);
  box-shadow: 0 18px 48px rgba(36,30,18,.09);
}
.input-card, .output-card { padding: clamp(18px, 3vw, 34px); }
textarea {
  width: 100%;
  min-height: 380px;
  resize: vertical;
  margin: 24px 0 18px;
  border: 1px solid var(--line);
  background: #141312;
  color: #f8f4ec;
  border-radius: 0;
  padding: 18px;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.report {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}
.report-card {
  border-left: 6px solid var(--hot);
  background: #f7efe1;
  padding: 16px 18px;
}
.report-card b { display: block; font-size: 18px; margin-bottom: 6px; }
.report-card ul { margin: 8px 0 0; padding-left: 20px; }
.evidence { padding: clamp(22px, 4vw, 48px); margin-bottom: 76px; }
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.step {
  border: 1px solid var(--line);
  min-height: 210px;
  background: #fffaf1;
  padding: 16px;
}
.step strong { display: block; font-size: 20px; margin-bottom: 8px; }
.step small {
  display: inline-flex;
  padding: 4px 8px;
  background: var(--ink);
  color: white;
  margin-bottom: 12px;
  font-weight: 850;
}
.step[data-status="blocked"] small { background: var(--hot); }
.step[data-status="pass"] small { background: var(--green); }
.step p { color: #4c463b; }
.checks {
  display: grid;
  grid-template-columns: .8fr 1fr;
  gap: 28px;
  padding: clamp(22px, 4vw, 48px);
  margin-bottom: 70px;
}
.checks p:last-child { font-size: clamp(18px, 2vw, 24px); color: #373127; margin: 0; }

/* real-run trace section */
.real-run {
  padding: clamp(22px, 4vw, 48px);
  margin-bottom: 70px;
}
.trace-intro { color: var(--muted); font-size: 15px; max-width: 72ch; margin-bottom: 24px; }
.trace-intro code { background: rgba(21,19,17,.06); padding: 2px 5px; border-radius: 3px; font-size: 13px; }
.trace-container {
  background: #18160f;
  color: #c8c0a8;
  border-radius: 10px;
  padding: 24px;
  font-family: "Fira Code", "JetBrains Mono", "Cascadia Code", ui-monospace, monospace;
  font-size: 13px;
  overflow-x: auto;
}
.trace-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(200,192,168,.15);
}
.trace-label { color: #a89f87; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.trace-header time { color: #6a6450; font-size: 12px; }
.score-pill { background: var(--blue); color: #fff; font-size: 11px; padding: 3px 9px; border-radius: 20px; letter-spacing: .04em; }
.trace-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.trace-step { }
.step-badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(200,192,168,.12);
  color: #c8c0a8;
  letter-spacing: .06em;
  margin-right: 6px;
}
.step-badge[data-status="pass"] { background: rgba(25,112,82,.3); color: #5de0aa; }
.step-badge[data-status="blocked"] { background: rgba(239,79,47,.25); color: #ff8060; }
.step-badge[data-status="warn"] { background: rgba(220,160,40,.2); color: #e8c060; }
.trace-step strong { color: #ede8da; }
.ms { color: #5a5445; font-size: 11px; margin-left: 8px; }
.trace-step p { margin: 4px 0 6px 0; color: #9a9080; }
.trace-evidence { display: flex; flex-direction: column; gap: 2px; }
.trace-evidence code { font-size: 11px; color: #7a7264; background: none; padding: 0; }
.trace-report { padding-top: 16px; border-top: 1px solid rgba(200,192,168,.12); margin-bottom: 14px; }
.trace-report em { color: #9a9080; }
.trace-blockers, .trace-actions { margin: 8px 0; padding-left: 18px; color: #9a9080; }
.trace-blockers li { color: #f07050; }
.trace-actions li { color: #5de0aa; }
.trace-source { color: #4a4438; font-size: 11px; border-top: 1px solid rgba(200,192,168,.1); padding-top: 12px; }
.trace-source code { color: #6a6450; background: none; }
.tool-count-pill { background: rgba(90,120,220,.35); color: #a0b8ff; font-size: 11px; padding: 3px 9px; border-radius: 20px; letter-spacing: .04em; }
.tool-calls-section { margin-bottom: 22px; }
.tool-calls-header { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(200,192,168,.12); }
.tool-call { border-left: 2px solid rgba(90,120,220,.4); padding-left: 12px; margin-bottom: 10px; }
.call-index { font-size: 10px; color: #6a6480; text-transform: uppercase; letter-spacing: .08em; margin-right: 6px; }
.tool-call strong { color: #b0b8d0; }
.tool-call .args { color: #7080a8; font-size: 11px; margin: 0 2px; }
.trace-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #5a5445; margin: 10px 0 4px 0; }
.trace-strengths { margin: 8px 0; padding-left: 18px; color: #5de0aa; }
.trace-strengths li { color: #5de0aa; }

footer {
  border-top: 1px solid var(--line);
  padding: 26px clamp(18px, 4vw, 48px) 34px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 860px) {
  .topbar { align-items: flex-start; }
  .hero, .workspace, .checks { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-panel { min-height: 420px; }
  .steps { grid-template-columns: 1fr; }
  h1 { font-size: clamp(48px, 15vw, 78px); }
}
