/* Zeroshot landing page. Plain CSS, no build step.
   One loud thing on the page: the dark run panel in the hero. Everything else is type on paper. */

:root {
  --bg: #f4f1ea;
  --surface: #fbfaf6;
  --ink: #171411;
  --ink-2: #3d3731;
  --muted: #6e665c;
  --line: #ddd5c8;
  --line-strong: #b9af9f;

  --code-key: #7a4a1c;
  --code-str: #2f6640;

  /* The run panel stays dark in both schemes. */
  --run-bg: #171411;
  --run-line: #2f2a25;
  --run-ink: #ece6dc;
  --run-muted: #968d81;
  --run-node: #1f1b17;
  --run-stroke: #4d453c;
  --run-done: #8c8377;
  --run-key: #e6c88f;
  --run-ok: #7fd19b;
  --run-bad: #ff8a5c;
  --run-amber: #e9b65a;

  --serif: ui-serif, "New York", "Iowan Old Style", Charter, "Bitstream Charter", Georgia, Cambria, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12100e;
    --surface: #1a1714;
    --ink: #f1ece3;
    --ink-2: #d3cbbf;
    --muted: #a0978a;
    --line: #2c2722;
    --line-strong: #4a423a;

    --code-key: #e6c88f;
    --code-str: #a9d3a6;

    --run-bg: #1c1915;
    --run-line: #332d27;
    --run-node: #24201b;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3, p { margin: 0; }

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

code { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code {
  padding: 0.08em 0.3em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
}
.skip-link:focus { top: 12px; }

/* Header */

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 17px/1 var(--mono);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.site-nav { display: flex; gap: 24px; font-size: 15px; }
.site-nav a { color: var(--ink-2); text-decoration: none; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }

.gh-stars {
  margin-left: 8px;
  font: 500 13px/1 var(--mono);
  color: var(--muted);
}
.gh-stars::before { content: "★ "; }

/* Hero: the claim, one install line, two links, then the run */

.hero { padding: clamp(20px, 3.5vw, 44px) 0 clamp(64px, 9vw, 112px); }

h1 {
  max-width: 21em;
  font-size: clamp(2rem, 1rem + 2.9vw, 3.5rem);
  line-height: 1.06;
}

.deck {
  margin-top: 14px;
  text-wrap: balance;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  color: var(--muted);
}

.try {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin: clamp(22px, 3vw, 30px) 0 clamp(24px, 3vw, 36px);
}

.try-links { display: flex; gap: 24px; font-weight: 500; }
.try-links a,
.more,
.opt-link a { text-decoration-color: currentColor; }
.try-links a::after,
.more::after,
.opt-link a::after { content: " →"; }

/* One-line command with a copy button. The line never wraps: on narrow screens
   the font scales so the full command fits on one line. */
.install {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "cmd copy";
  align-items: center;
  gap: 16px;
  max-width: 100%;
  padding: 7px 7px 7px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}
.install-label { display: none; grid-area: label; }
.install code {
  grid-area: cmd;
  min-width: 0;
  padding: 0;
  background: none;
  overflow-x: auto;
  font-size: 15px;
  line-height: 1.5;
}

.copy {
  grid-area: copy;
  justify-self: end;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  font: 500 12px/1 var(--mono);
  cursor: pointer;
}
.copy:hover { color: var(--ink); border-color: var(--ink-2); }
.copy[data-copied] { color: var(--code-str); border-color: currentColor; }

@media (max-width: 639px) {
  .install {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "label copy" "cmd cmd";
    gap: 8px;
    width: 100%;
    padding: 8px 12px 10px;
  }
  .install-label {
    display: block;
    font: 500 12px/1 var(--mono);
    color: var(--muted);
  }
  /* 50 characters at about 0.61em each, inside the box's padding and border. */
  .install code { font-size: clamp(10px, calc((100vw - 2 * var(--gutter) - 26px) / 30.8), 15px); }
}

/* Run panel */

.run {
  margin: 0;
  border: 1px solid var(--run-line);
  border-radius: 14px;
  background: var(--run-bg);
  color: var(--run-ink);
  overflow: hidden;
  box-shadow: 0 40px 80px -48px rgb(23 20 17 / 0.6);
}

.run-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-height: 48px;
  padding: 8px 10px 8px 18px;
  border-bottom: 1px solid var(--run-line);
  font: 500 13px/1 var(--mono);
}

.run-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 8ch;
}
.run-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--run-muted);
}
.run-state[data-state="running"]::before { background: var(--run-amber); animation: blink 1.1s ease-in-out infinite; }
.run-state[data-state="passed"]::before { background: var(--run-ok); }
/* Without the script the panel is a still frame, not a run in progress. */
html:not(.js) .run-state { display: none; }

.run-note {
  padding: 4px 7px;
  border: 1px solid var(--run-stroke);
  border-radius: 4px;
  font-size: 12px;
  color: var(--run-ink);
}
.run-name { color: var(--run-muted); }

.run-controls { display: flex; gap: 6px; margin-left: auto; }
.run-btn {
  padding: 7px 10px;
  border: 1px solid var(--run-line);
  border-radius: 5px;
  background: transparent;
  color: var(--run-muted);
  font: 500 12px/1 var(--mono);
  cursor: pointer;
}
.run-btn:hover { border-color: var(--run-stroke); color: var(--run-ink); }
.run-btn:focus-visible { outline-color: var(--run-ink); }

.run-body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
}

.run-graph {
  display: flex;
  align-items: center;
  padding: clamp(14px, 2vw, 28px);
  border-right: 1px solid var(--run-line);
}

.run-log {
  padding: clamp(14px, 2vw, 26px) clamp(14px, 2vw, 28px);
  font: 13px/1.75 var(--mono);
}

/* Stacked panel: the log comes first, so the rejection is on the first screen, and it scrolls
   inside a fixed window like a terminal instead of reserving room for lines still to come. */
@media (max-width: 899px) {
  .run-body { grid-template-columns: minmax(0, 1fr); }
  .run-log { order: -1; }
  .run-graph { border-right: 0; border-top: 1px solid var(--run-line); }
  .js .log { height: calc(10 * 1.75em); overflow: hidden; }
  .js .log li:not(.is-shown) { display: none; }
  .log.is-scrolled {
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 2.5em);
    mask-image: linear-gradient(to bottom, transparent, #000 2.5em);
  }
}

.log-task {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--run-line);
  color: var(--run-muted);
}
.log-key { margin-right: 1ch; color: var(--run-key); }

.log { margin: 0; padding: 0; list-style: none; }
.log li {
  display: grid;
  grid-template-columns: 5ch 10ch minmax(0, 1fr);
  column-gap: 1.5ch;
  margin: 0 -8px;
  padding: 0 8px;
  border-radius: 4px;
}
.log .t { color: var(--run-muted); }
.log .a { color: var(--run-key); }
.log .ok { color: var(--run-ok); }
.log .bad { color: var(--run-bad); }
.log li.is-reject { background: color-mix(in srgb, var(--run-bad) 13%, transparent); }

.js .log li { visibility: hidden; opacity: 0; }
.js .log li.is-shown {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.25s ease-out;
}

/* Graph (inline SVG) */

.graph {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.edge {
  fill: none;
  stroke: var(--run-stroke);
  stroke-width: 1.5;
  transition: stroke 0.3s;
}
.edge.is-done { stroke: var(--run-done); }
.edge.is-active { stroke: var(--run-ink); stroke-width: 2; }
.graph.is-rejecting .edge-reject,
.edge-reject.is-active { stroke: var(--run-bad); stroke-width: 2; }
.arrow-head { fill: var(--run-done); }
.junction { fill: var(--run-done); }

.e-label {
  font: 10px var(--mono);
  fill: var(--run-muted);
  text-anchor: middle;
}
.graph.is-rejecting .e-label-reject { fill: var(--run-bad); }

.n-box {
  fill: var(--run-node);
  stroke: var(--run-stroke);
  stroke-width: 1.25;
  transition: fill 0.3s, stroke 0.3s;
}
.node-optional .n-box { stroke-dasharray: 4 3; }
.n-title { font: 600 13px var(--mono); fill: var(--run-ink); }
.n-sub { font: 11px var(--sans); fill: var(--run-muted); }

.n-badge { opacity: 0; transition: opacity 0.2s; }
.n-badge circle { fill: var(--run-muted); }
.n-glyph {
  font: 700 10px var(--sans);
  fill: var(--run-bg);
  text-anchor: middle;
}

.node.is-running .n-box { stroke: var(--run-amber); fill: color-mix(in srgb, var(--run-amber) 14%, var(--run-node)); }
.node.is-running .n-badge { opacity: 1; animation: blink 1.1s ease-in-out infinite; }
.node.is-running .n-badge circle { fill: var(--run-amber); }

.node.is-approved .n-box { stroke: var(--run-ok); fill: color-mix(in srgb, var(--run-ok) 12%, var(--run-node)); }
.node.is-approved .n-badge { opacity: 1; }
.node.is-approved .n-badge circle { fill: var(--run-ok); }

.node.is-rejected .n-box { stroke: var(--run-bad); fill: color-mix(in srgb, var(--run-bad) 16%, var(--run-node)); }
.node.is-rejected .n-badge { opacity: 1; }
.node.is-rejected .n-badge circle { fill: var(--run-bad); }

.node.is-done .n-box { stroke: var(--run-done); }
.node.is-done .n-badge { opacity: 1; }
.node.is-done .n-badge circle { fill: var(--run-done); }

.g-shape {
  fill: var(--run-node);
  stroke: var(--run-stroke);
  stroke-width: 1.25;
  transition: fill 0.3s, stroke 0.3s;
}
.g-glyph {
  font: 700 13px var(--mono);
  fill: var(--run-muted);
  text-anchor: middle;
}
.gate.is-approved .g-shape { stroke: var(--run-ok); fill: var(--run-ok); }
.gate.is-rejected .g-shape { stroke: var(--run-bad); fill: var(--run-bad); }
.gate.is-approved .g-glyph,
.gate.is-rejected .g-glyph { fill: var(--run-bg); }

.pulse { fill: var(--run-ink); }
.pulse.is-bad { fill: var(--run-bad); }

@media (max-width: 639px) {
  .n-sub,
  .labels { display: none; }
  .n-title { font-size: 17px; transform: translateY(9px); }
  .n-badge circle { r: 10; }
  .n-glyph { font-size: 12px; }
  .g-glyph { font-size: 16px; }
  .run-head { padding-left: 14px; gap: 8px 10px; font-size: 12px; }
  .run-name { display: none; }
  .run-note { font-size: 11px; padding: 4px 6px; }
  .run-btn { padding: 7px 8px; font-size: 11px; }
  .run-log { font-size: 11.5px; }
  .log li { column-gap: 1ch; }
}

@keyframes blink {
  50% { opacity: 0.35; }
}

/* Sections after the hero: type on paper, separated by space and a rule */

.why,
.start,
.more-section,
.out { padding: clamp(56px, 7.5vw, 104px) 0; }

.start,
.more-section,
.out { border-top: 1px solid var(--line); }

h2 {
  font-size: clamp(1.75rem, 1.1rem + 1.9vw, 2.6rem);
  line-height: 1.15;
}

h3 { font-size: 1rem; font-weight: 650; letter-spacing: -0.005em; }

/* Why */

.why h2 { max-width: 25em; font-weight: 400; }

.versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px clamp(32px, 5vw, 72px);
  margin-top: clamp(40px, 5vw, 64px);
}

.side h3 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}
.side-solo h3 { color: var(--muted); border-bottom-color: var(--line-strong); }

.actors { margin: 0; padding: 0; list-style: none; }
.actors li {
  display: grid;
  grid-template-columns: 11ch minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.who {
  padding-top: 0.12em;
  font: 500 14px/1.6 var(--mono);
}
.side-solo li { color: var(--muted); }
.side-zs .who { font-weight: 650; }

@media (max-width: 799px) {
  .versus { grid-template-columns: minmax(0, 1fr); }
}

.why-point {
  max-width: 44em;
  margin-top: clamp(36px, 4vw, 52px);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  color: var(--ink);
}
.why-fine {
  max-width: 52em;
  margin-top: 14px;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Quickstart */

.steps {
  margin: clamp(28px, 4vw, 44px) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 20px clamp(28px, 5vw, 64px);
  align-items: start;
  padding: clamp(24px, 3vw, 36px) 0;
  border-top: 1px solid var(--line);
  counter-increment: step;
}
.step:first-child { border-top: 0; padding-top: 0; }

.step h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1.125rem;
}
.step h3::before {
  content: counter(step);
  font: 400 1.5rem/1 var(--serif);
  color: var(--muted);
}

.step-text { display: grid; gap: 10px; }
.step-text p { font-size: 0.9688rem; color: var(--ink-2); }
.step-code { display: grid; gap: 14px; min-width: 0; }
.step-code .install { justify-self: start; }

@media (max-width: 899px) {
  .step { grid-template-columns: minmax(0, 1fr); }
}

/* Code blocks: light, so the run panel stays the only dark thing on the page.
   Lines wrap rather than clip. */
.code {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 5px 6px 5px 16px;
  border-bottom: 1px solid var(--line);
  font: 500 12px/1 var(--mono);
  color: var(--muted);
}
.code pre {
  margin: 0;
  padding: 14px 16px 16px;
  font: 13px/1.65 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}
.code pre code { font-size: inherit; }
/* A wrapped JSON string continues under the start of the string. */
.code .hang { display: block; padding-left: 11ch; text-indent: -11ch; }
.tk { color: var(--code-key); }
.ts { color: var(--code-str); }

/* Everything else, one line each */

.more-lede {
  max-width: 44em;
  margin-top: 16px;
  color: var(--ink-2);
}

.options {
  margin: clamp(28px, 4vw, 44px) 0 0;
  border-top: 1px solid var(--ink);
}
.opt {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr) 9.5rem;
  gap: 4px 32px;
  align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.opt dt code {
  padding: 0;
  background: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.opt dt code + code { margin-left: 1ch; }
.opt dd { margin: 0; color: var(--ink-2); }
.opt-link { font-size: 0.9375rem; text-align: right; white-space: nowrap; }

@media (max-width: 899px) {
  .opt {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "term link" "desc desc";
    column-gap: 16px;
  }
  .opt dt { grid-area: term; }
  .opt dd { grid-area: desc; }
  .opt .opt-link { grid-area: link; }
}

/* The way out */

.out h2 { font-size: clamp(2rem, 1.1rem + 2.6vw, 3.25rem); }

.exits {
  margin: clamp(28px, 4vw, 44px) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}
.exits a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 24px;
  padding: clamp(16px, 2vw, 22px) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.exit-name {
  flex: 0 0 auto;
  min-width: 7.5em;
  font: 500 clamp(1.5rem, 1.1rem + 1.2vw, 2rem)/1.2 var(--serif);
}
.exit-url {
  flex: 1 1 auto;
  font: 14px/1.5 var(--mono);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.exits a::after {
  content: "→";
  margin-left: auto;
  font-size: 1.5rem;
  line-height: 1;
}
.exits a:hover .exit-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

.out-note {
  max-width: 48em;
  margin-top: 24px;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Footer */

.site-footer {
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* The still frame shows the whole log, so nothing needs to scroll. */
  .js .log { height: auto; }
  .log.is-scrolled { -webkit-mask-image: none; mask-image: none; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* The real Zeroshot crow replaces the generated ring mark (same on both experiment pages). */
img.brand-mark { width: 22px; height: auto; }
@media (prefers-color-scheme: dark) { img.brand-mark { filter: invert(1); } }
