:root {
  --bg:      #0e0e0f;
  --panel:   #161617;
  --panel-2: #1e1e20;
  --line:    #2b2b2d;
  --line-2:  #3d3d40;
  --text:    #ececec;
  --text-2:  #a2a2a5;
  --dim:     #74747a;
  --amber:   #e8a33d;
  --amber-2: #f5bc63;
  --green:   #5bc08c;
  --red:     #e06c6c;
  --mono:    "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

/* ---------- header ---------- */

.topbar {
  max-width: 1040px;
  margin: 0 auto;
  padding: 30px 24px 18px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.logo  { width: 42px; height: 42px; display: block; flex: none; }

.topbar h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tagline { margin: 1px 0 0; font-size: 13px; color: var(--text-2); }

/* ---------- layout ---------- */

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 70px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.card h2 {
  margin: 0;
  padding: 13px 16px 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--dim);
}

/* ---------- the brief ---------- */

.brief {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}

.brief label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--dim);
  margin-bottom: 9px;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; }

input[type="text"] {
  flex: 1;
  min-width: 250px;
  height: 46px;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 7px;
}

input::placeholder { color: var(--dim); }

button {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  height: 46px;
  padding: 0 22px;
  cursor: pointer;
  color: #16130c;
  background: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 7px;
}

button:hover:not(:disabled) { background: var(--amber-2); border-color: var(--amber-2); }
button:disabled { opacity: 0.45; cursor: default; }

input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.examples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.examples button {
  height: auto;
  padding: 5px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 999px;
}

.examples button:hover:not(:disabled) { color: var(--text); background: var(--panel-2); }

.status { margin: 13px 0 0; font-size: 13px; color: var(--text-2); min-height: 20px; }
.status.error { color: var(--red); }

/* ---------- the pipeline ---------- */

.pipeline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 2px;
}

.stage {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

/* A dash between stages, so it reads as a pipeline rather than five tags. */
.stage:not(:last-child)::after {
  content: "";
  position: relative;
  left: 7px;
  width: 8px;
  height: 1px;
  background: var(--line-2);
}

.pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-2);
  flex: none;
}

.stage[data-state="working"] { color: var(--text); border-color: var(--amber); }
.stage[data-state="working"] .pip { background: var(--amber); animation: pulse 1.1s ease-in-out infinite; }
.stage[data-state="done"] { color: var(--text-2); }
.stage[data-state="done"] .pip { background: var(--green); }
.stage[data-state="failed"] .pip { background: var(--red); }

@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .pip { animation: none !important; } }

/* ---------- two columns ---------- */

.columns {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 16px;
  align-items: start;
}

.notes-col, .work-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

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

/* ---------- prose ---------- */

.prose { padding: 8px 16px 15px; font-size: 14px; color: var(--text-2); }
.prose p { margin: 0 0 9px; }
.prose ul { margin: 0 0 9px; padding-left: 19px; }
.prose li { margin-bottom: 5px; }
.prose li::marker { color: var(--amber); }
.prose strong { color: var(--text); font-weight: 600; }
.prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--panel-2);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--amber-2);
}
.prose h3 { margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.prose h3:first-child { margin-top: 0; }

/* ---------- the file and the terminal ---------- */

.file-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
}

.dots { display: flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); display: block; }

.prompt { color: var(--amber); font-weight: 600; }
.filename { color: var(--text-2); flex: 1; overflow-wrap: anywhere; }

.round-tag, .verdict { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.round-tag { color: var(--amber); }
.verdict.pass { color: var(--green); }
.verdict.fail { color: var(--red); }

pre.code, pre.output {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.62;
  overflow-x: auto;
  white-space: pre;
  tab-size: 4;
}

pre.output { font-size: 12.5px; color: var(--text-2); max-height: 260px; overflow-y: auto; }

/* Enough colour to read the shape of the code, not a full highlighter. */
.tok-kw   { color: #c792ea; }
.tok-str  { color: #b7d98a; }
.tok-num  { color: #f0a868; }
.tok-com  { color: var(--dim); font-style: italic; }
.tok-def  { color: #7fc8f8; }

/* ---------- footer ---------- */

.colophon {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--dim);
  text-align: center;
}

.colophon a { color: var(--amber); text-decoration: none; }
.colophon a:hover { text-decoration: underline; }

[hidden] { display: none !important; }
