/* Colours and shapes match https://khadir-syed.github.io */
:root {
  --bg: #0b0a09;
  --card: #1c1917;
  --line: #292524;
  --text: #f5f5f4;
  --muted: #a8a29e;
  --soft: #d6d3d1;
  --amber: #fbbf24;
  --amber-soft: #fcd34d;
  --orange: #d97706;
  --glow: rgba(217, 119, 6, 0.18);
  --missed: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg) radial-gradient(circle at 50% 0%, var(--glow) 0%, rgba(11, 10, 9, 0) 60%) no-repeat;
  color: var(--text);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; }

.hero { text-align: center; margin-bottom: 20px; }
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 9999px;
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber-soft); font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
}
h1 {
  margin: 12px 0 4px; font-size: 28px; font-weight: 900; letter-spacing: -0.6px;
  text-transform: uppercase; color: #fff;
}
.subtitle {
  margin: 0; color: var(--amber); font-size: 13px; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase;
}
h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; margin: 16px 0;
}
.card p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
.warning {
  border-left: 3px solid var(--orange); background: rgba(217, 119, 6, 0.08);
  padding: 10px 14px; border-radius: 8px; color: var(--soft); font-size: 14px;
}
.warning.small { font-weight: 600; }

.btn {
  background: var(--orange); color: #0b0a09; border: 0; border-radius: 10px;
  padding: 10px 18px; font-size: 15px; font-weight: 800; cursor: pointer;
}
.btn:hover { background: var(--amber); }
.btn:disabled { opacity: 0.5; cursor: wait; }
.btn:focus-visible, textarea:focus-visible, .link-card:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}

.output {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin: 12px 0; font-size: 13px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.output:empty { display: none; }
.redacted { background: #000; color: var(--amber-soft); border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; }
.missed-line { color: var(--missed); }
.tag { color: var(--amber); font-weight: 700; }
.summary { color: #fff; font-weight: 700; }
/* Divider lines are long; on a phone, cut them at the edge instead of wrapping. */
.rule { display: inline-block; max-width: 100%; overflow: hidden; white-space: nowrap; vertical-align: bottom; }

.legend { font-size: 13px; color: var(--muted); }
.legend .redacted, .legend .missed-line { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.chip-missed { margin-left: 12px; }

textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; font-family: inherit; font-size: 15px; line-height: 1.5; resize: vertical;
}

.link-card {
  display: block; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-top: 10px; color: var(--text); font-weight: 700; text-decoration: none;
}
.link-card:hover { border-color: var(--orange); }

.footer {
  text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 1px;
  text-transform: uppercase; margin-top: 28px;
}

/* The 6 examples */
.examples { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.ex { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.ex p { margin: 0 0 6px; }
.ex p:last-child { margin-bottom: 0; }
.ex-what { font-weight: 700; }
.ex-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ex-flow code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px;
  word-break: break-word;
}
.ex-flow code.redacted { background: #000; }
.arrow { color: var(--muted); font-size: 13px; }
.ex-why { font-size: 14px; color: var(--soft); }
.ex-why.missed { color: #fca5a5; }
.ex-stale { border-color: var(--missed); }
.lesson { font-weight: 700; color: #fff; }

/* Try it yourself */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip-btn {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 9999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.chip-btn:hover { border-color: var(--orange); }
.chip-btn:disabled { opacity: 0.5; cursor: wait; }
.chip-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.try-label { font-weight: 700; margin: 8px 0 6px; }

/* Back link on each demo page */
.back { display: inline-block; color: var(--muted); font-size: 14px; text-decoration: none; margin-bottom: 8px; }
.back:hover { color: var(--amber); }
.back:focus-visible, .badge:focus-visible, .demo-card:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Home page: brand header, same as https://khadir-syed.github.io */
.brand .brand-frame {
  width: 112px; height: 112px; margin: 0 auto 16px; padding: 2.5px; border-radius: 28px;
  background: linear-gradient(to bottom, #fbbf24, #f59e0b, #78350f);
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.35), inset 0 0 10px rgba(245, 158, 11, 0.2);
}
.brand img { display: block; width: 100%; height: 100%; border-radius: 25.5px; object-fit: cover; background: #0c0a09; }
.brand .badge { text-decoration: none; }
.brand-name {
  margin: 10px 0 2px; font-size: 30px; font-weight: 900; letter-spacing: -0.6px;
  text-transform: uppercase; color: #fff; line-height: 1.2;
}
.brand-name span { color: var(--amber); }
.brand .subtitle { color: rgba(253, 230, 138, 0.9); }
.pills { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 14px 0 0; padding: 0; }
.pills li {
  font-size: 11px; font-weight: 500; padding: 2px 10px; border-radius: 6px;
  background: var(--card); border: 1px solid var(--line); color: var(--soft);
}
.hook { margin: 12px 0 0; color: var(--muted); font-size: 12px; font-style: italic; }
.card h1 { margin-top: 0; font-size: 22px; line-height: 1.25; }

.demo-card {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 20px; margin: 12px 0; color: var(--text); text-decoration: none;
}
.demo-card:hover { border-color: var(--orange); background: #24201c; }
.demo-num { display: block; color: var(--amber); font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.demo-title { display: block; font-size: 18px; font-weight: 800; margin: 2px 0 4px; }
.demo-card:hover .demo-title { color: var(--amber-soft); }
.demo-line { display: block; color: var(--muted); font-size: 14px; }

/* Demo 07: vague vs clear */
.side { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.side-head code, .prompt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px;
  word-break: break-word;
}
.count { font-weight: 700; color: var(--amber-soft); font-size: 14px; }
.count:empty { display: none; }
.vague .count { color: #fca5a5; }
/* AI answers, formatted by markdown.js; "clamped" shows only the first 3 lines. */
.answer {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin: 6px 0 8px;
}
.more-btn { margin-top: 6px; }
.md { font-size: 14px; line-height: 1.55; color: var(--soft); overflow-wrap: break-word; }
.md.clamped {
  max-height: calc(3 * 1.55em); overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h3, .md h4 { color: #fff; font-weight: 800; line-height: 1.3; margin: 14px 0 6px; }
.md h3 { font-size: 16px; }
.md h4 { font-size: 15px; }
.md p, .md ul, .md ol { margin: 0 0 8px; }
.md ul, .md ol { padding-left: 22px; }
.md li ul, .md li ol { margin: 2px 0 0; }
.md strong { color: #fff; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md-table { overflow-x: auto; margin: 0 0 8px; }
.md table { border-collapse: collapse; font-size: 13px; line-height: 1.45; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; min-width: 7em; }
.md th { background: var(--card); color: #fff; }
.more-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--amber); font: inherit; font-size: 14px; font-weight: 700;
}
.more-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.changes { margin: 0 0 8px; padding-left: 20px; font-size: 14px; color: var(--soft); }
.score-line { margin: 0; }

/* Demo 07: check your own question */
.check-score { font-size: 18px; font-weight: 800; color: #fff; margin: 12px 0 6px; }
.check-score:empty, .check-list:empty { display: none; }
.check-list { list-style: none; margin: 0 0 12px; padding: 0; font-size: 14px; }
.check-list li { padding: 4px 0; color: var(--soft); }
.check-list .pass b { color: #86efac; }
.check-list .fail b { color: #fca5a5; }

/* Demo 03: each example's steps */
.ex .ex-trace { margin: 6px 0 8px; }

/* Demo 02: stories, found paragraphs and match scores */
.stories { margin: 0 0 12px; padding-left: 22px; color: var(--soft); }
.found { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0 8px; }
.ex .found p { margin: 0 0 4px; }
.found p:last-child { margin-bottom: 0; }
.found-story { font-size: 13px; font-weight: 700; color: var(--amber); }
.found-text { font-size: 14px; color: var(--soft); }
.found-text.none { color: var(--muted); }
.matches { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.match {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
}
.match-story { font-size: 13px; font-weight: 700; }
.match-pct { font-size: 13px; font-weight: 700; color: var(--amber-soft); font-variant-numeric: tabular-nums; }
.bar-track { grid-column: 1 / -1; height: 6px; background: var(--line); border-radius: 9999px; overflow: hidden; }
.bar { display: block; height: 100%; background: var(--orange); border-radius: 9999px; }
.match-text { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }

/* Demos 08 and 10: the filter switch and the handoff choice */
.options { border: 0; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.options legend { padding: 0; width: 100%; }
.option, .options label { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 15px; cursor: pointer; }
.option input, .options input { accent-color: var(--orange); width: 18px; height: 18px; }
.option input:focus-visible, .options input:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
/* Demo 10: the drafted form is indented like in a terminal, so keep each line
   whole and let the box scroll sideways instead of wrapping it into a mess. */
.output.keep-lines { white-space: pre; word-break: normal; }

/* Demo 06: the saved AI answers, both sides */
.ai-answer {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin: 6px 0 8px; font-size: 14px; color: var(--soft); white-space: pre-line;
}
.ex .ai-answer { margin: 6px 0 8px; }
.side-head { font-size: 14px; font-weight: 700; }

/* Demo 01: tokens as little bricks, and GPT-2's guesses as bars */
.tokens { list-style: none; margin: 6px 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tokens li { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.tok {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; white-space: pre;
  background: var(--card); border: 1px solid var(--orange); border-radius: 6px; padding: 3px 7px; color: var(--text);
}
.tok-id { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tok-total { font-weight: 700; color: var(--amber-soft); margin: 8px 0 0; }
.meter {
  grid-column: 1 / -1; width: 100%; height: 6px; border: 0; border-radius: 9999px; overflow: hidden;
  -webkit-appearance: none; appearance: none; background: var(--line);
}
.meter::-webkit-progress-bar { background: var(--line); border-radius: 9999px; }
.meter::-webkit-progress-value { background: var(--orange); border-radius: 9999px; }
.meter::-moz-progress-bar { background: var(--orange); border-radius: 9999px; }
.guesses { margin-bottom: 8px; }
.inline-link { color: var(--amber); }
.inline-link:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Demo 05: the notepad */
.steps { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; }
.steps .step { margin: 0; }
.step p { margin: 0 0 6px; }
.step p:last-child { margin-bottom: 0; }
.step-msg { font-size: 15px; }
.step-who { font-weight: 700; color: var(--amber); }
.msg { color: var(--text); }
.step-n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.step-dropped { font-size: 14px; color: #fca5a5; }
.step-used { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--amber-soft); font-weight: 700; }
.step-used .meter { flex: 1; min-width: 80px; }
.still { margin: 0 0 12px; padding-left: 22px; font-size: 14px; color: var(--soft); }
.still li { margin: 2px 0; }
.still.gone { color: var(--muted); }
.still.gone .msg { color: var(--muted); text-decoration: line-through; }
.option-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.option-row .try-label { margin: 0; }
select, input[type="text"] {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 15px;
}
select:focus-visible, input[type="text"]:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.send-row { display: flex; gap: 8px; margin-bottom: 12px; }
.send-row input { flex: 1; min-width: 0; }
/* A letter cut into several tokens: its pieces in a bracket, the letter below. */
.tok-group {
  flex-direction: column; border: 1px dashed var(--amber); border-top: 0;
  border-radius: 0 0 10px 10px; padding: 0 6px 4px;
}
.tok-group .tokens { margin: 0; }
.tok-letter { font-size: 18px; line-height: 1.2; color: var(--amber-soft); font-weight: 700; }
.tok-note { margin: 0 0 10px; font-size: 13px; }
.tok-ids { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--amber-soft); word-break: break-word; }

/* "More detail" boxes: the exact technical wording, one tap away. */
.grownups { margin: -4px 0 16px; }
.grownups summary { cursor: pointer; color: var(--amber-soft); font-size: 14px; font-weight: 600; }
.grownups p { margin: 6px 0 0; }
/* Keep a verdict or lesson from sitting flush against the box above it. */
.side + .ex-why { margin-top: 12px; }
.ex + .lesson { margin-top: 16px; }
