/* Deliberately hand-written and dependency-free. The page is one form and one
   result list, so a framework would be more code than the thing it renders, and
   this loads in a single request on a free-tier container. */

:root {
  --ink: #12161c;
  --paper: #fbfaf8;
  --line: #dcd8d2;
  --muted: #5c6470;
  --accent: #1c5d4a;
  --supported: #1c5d4a;
  --refuted: #96341f;
  --unknown: #6b5e2a;
  --highlight: #fff3c4;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e6e2;
    --paper: #14171b;
    --line: #2c3138;
    --muted: #9aa1ac;
    --accent: #6cc3a5;
    --supported: #6cc3a5;
    --refuted: #e8907a;
    --unknown: #d9c47c;
    --highlight: #3d3720;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  max-width: 46rem;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 {
  margin: 0 0 0.4rem;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

h2 {
  margin: 2rem 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.lede {
  margin: 0 0 0.75rem;
  color: var(--muted);
  max-width: 38rem;
}

.status {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

form {
  margin-top: 1.75rem;
}

label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  resize: vertical;
}

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

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.875rem;
  color: var(--ink);
  cursor: pointer;
}

.check small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

button {
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

button:hover:not(:disabled) {
  filter: brightness(1.08);
}

button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.examples {
  margin-top: 1.5rem;
}

#exampleButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.example {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  text-align: left;
  max-width: 100%;
}

.example:hover {
  color: var(--ink);
  border-color: var(--accent);
  filter: none;
}

.verdict {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.verdict[data-v="SUPPORTED"] {
  color: var(--supported);
}
.verdict[data-v="REFUTED"] {
  color: var(--refuted);
}
.verdict[data-v="NOT_ENOUGH_INFO"] {
  color: var(--unknown);
}

.reasoning {
  font-size: 1.0625rem;
  margin: 0.85rem 0 0;
}

.warning,
.error {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--unknown);
  background: color-mix(in oklab, var(--unknown) 10%, transparent);
  font-size: 0.875rem;
}

.error {
  border-left-color: var(--refuted);
  background: color-mix(in oklab, var(--refuted) 10%, transparent);
}

.timing,
.hint,
.disclaimer {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.sources {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.sources li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.sources li.cited {
  border-color: var(--accent);
}

.source-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.source-title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.source-meta {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sentence {
  font-size: 0.875rem;
  color: var(--muted);
}

.sentence.cited {
  background: var(--highlight);
  color: var(--ink);
  border-radius: 3px;
  padding: 0 0.15rem;
}

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

a {
  color: var(--accent);
}
