:root {
  --paper:   #fbf7ef;
  --paper-2: #f3ece0;
  --rule:    #ded5c4;
  --rule-2:  #ccc2ae;
  --ink:     #2f2921;
  --ink-2:   #5c5344;
  --muted:   #8a7f6d;
  --accent:  #8250c8;
  --accent-2:#6a3caa;
  --serif:   "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  /* A faint horizontal rule pattern, like the tint block on a journal page. */
  background-image: linear-gradient(var(--paper-2) 1px, transparent 1px);
  background-size: 100% 34px;
  background-position: 0 -1px;
}

/* ---------- masthead ---------- */

.masthead {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 26px 20px;
  border-bottom: 2px solid var(--ink);
}

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

.masthead h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.tagline {
  margin: 2px 0 0;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

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

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 26px 80px;
}

section, article { margin-top: 28px; }

/* Section headings sit on a rule, the way a journal breaks its columns. */
.rule-heading {
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rule);
}

/* ---------- the question ---------- */

.ask label {
  display: block;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 9px;
}

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

input[type="text"] {
  flex: 1;
  min-width: 250px;
  height: 50px;
  padding: 0 15px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  background: #fffdf9;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
}

input::placeholder { color: #b3a892; }

button {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  height: 50px;
  padding: 0 24px;
  cursor: pointer;
  color: #fffdf9;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
}

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

button.secondary {
  height: 42px;
  padding: 0 18px;
  color: var(--accent-2);
  background: transparent;
  border: 1px solid var(--accent);
}

button.secondary:hover:not(:disabled) { background: rgba(130, 80, 200, 0.08); }

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

.examples { display: flex; flex-direction: column; gap: 5px; margin-top: 14px; }

/* Example questions read as a list of suggestions, not a row of chips —
   they are full sentences and chips would truncate them. */
.examples button {
  height: auto;
  padding: 3px 0;
  text-align: left;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-2);
  background: none;
  border: none;
  border-radius: 0;
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 3px;
}

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

.status {
  margin: 14px 0 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
  min-height: 20px;
}

.status.error { color: #a8322c; }

/* ---------- what it did ---------- */

.log { margin: 0; padding: 0; list-style: none; counter-reset: step; }

.log li {
  position: relative;
  padding: 0 0 14px 30px;
  font-size: 15px;
  color: var(--ink-2);
}

/* A numbered rail down the left, with the line connecting the steps. */
.log li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.log li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 25px;
  bottom: 2px;
  width: 1px;
  background: var(--rule);
}

.log .what { color: var(--ink); }
.log .query { font-style: italic; }
.log .found { font-family: var(--sans); font-size: 12.5px; color: var(--muted); }

.log li.working .what::after {
  content: "…";
  color: var(--accent);
}

/* ---------- the report ---------- */

.answer { font-size: 17.5px; }
.answer p { margin: 0 0 14px; }
.answer ul { margin: 0 0 14px; padding-left: 22px; }
.answer li { margin-bottom: 6px; }
.answer strong { font-weight: 700; }

.answer h3 {
  margin: 22px 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.answer h3:first-child { margin-top: 0; }

/* Citations link down to the sources list. Superscript keeps them out of the
   way of the sentence while staying clickable. */
.cite {
  font-family: var(--sans);
  font-size: 0.68em;
  font-weight: 600;
  vertical-align: super;
  color: var(--accent-2);
  text-decoration: none;
  padding: 0 1px;
}

.cite:hover { text-decoration: underline; }

.sources-block { margin-top: 30px; }

.sources { margin: 0; padding-left: 22px; font-size: 15px; }
.sources li { margin-bottom: 10px; color: var(--ink-2); }
.sources li:target { background: rgba(130, 80, 200, 0.10); }
.sources .title { color: var(--ink); }

.sources a {
  display: block;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--accent-2);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.sources a:hover { text-decoration: underline; }

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.hint { font-family: var(--sans); font-size: 12.5px; color: var(--muted); }

/* ---------- colophon ---------- */

.colophon {
  margin: 40px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

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

[hidden] { display: none !important; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .masthead { padding: 28px 20px 16px; }
  .masthead h1 { font-size: 25px; }
  main { padding: 0 20px 60px; }
}
