/* Stet: a proofreader's sheet. Cream paper, black ink, a red pencil for errors. */
:root {
  --paper: #f6f1e7;
  --sheet: #fffdf8;
  --ink: #1d1b18;
  --ink-2: #57524a;
  --rule: #ddd4c3;
  --red: #b3261e;
  --red-wash: #fbeae6;
  --ochre: #8a5a00;
  --ochre-wash: #fbf1dc;
  --pencil: #3d5a80;
  --pencil-wash: #e9eef5;
  --green: #2f6b3a;
  --green-wash: #e7f1e7;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 6px;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; font: 16px/1.55 var(--sans); }
a { color: var(--pencil); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pencil); outline-offset: 2px; }

.top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--rule); background: var(--paper);
  position: sticky; top: 0; z-index: 5;
}
.mark { text-decoration: none; color: var(--ink); display: flex; align-items: baseline; gap: .6rem; }
.mark-word { font: 600 1.6rem var(--serif); letter-spacing: .01em; }
.mark-word::after { content: "‸"; color: var(--red); margin-left: .1rem; }
.mark-sub { font: italic .9rem var(--serif); color: var(--ink-2); }
.tabs { display: flex; gap: .25rem; }
.tabs a { padding: .35rem .75rem; border-radius: 99px; text-decoration: none; color: var(--ink-2); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }

main { max-width: 920px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2rem) 8rem; }
.lede { color: var(--ink-2); max-width: 62ch; }
.meta { color: var(--ink-2); font-size: .9rem; margin: .25rem 0; }
.err { color: var(--red); min-height: 1.2em; }
.empty { color: var(--ink-2); }

label { display: block; font-weight: 600; font-size: .9rem; margin: 1rem 0 .3rem; }
label input, label select, label textarea { display: block; width: 100%; margin-top: .3rem; font-weight: 400; }
input, select, textarea {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: .6rem .7rem;
}
textarea { font-family: var(--serif); font-size: 1rem; line-height: 1.6; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } h1 { font-size: 1.6rem; } }

button {
  border: 1px solid var(--ink); background: var(--sheet); border-radius: var(--radius);
  padding: .5rem .9rem; cursor: pointer; font-weight: 600; font-size: .9rem;
}
button:hover { background: var(--paper); }
button.primary { background: var(--ink); color: var(--paper); padding: .7rem 1.3rem; margin-top: 1rem; }
button.primary:hover { background: #000; }
button.small { padding: .3rem .6rem; font-size: .85rem; font-weight: 500; }
button.quiet { border-color: var(--rule); color: var(--ink-2); }
button:disabled { opacity: .5; cursor: default; }

/* lock */
.lock { max-width: 360px; margin: 10vh auto; }
.lock-form button { margin-top: 1rem; }

/* check list */
.check-list, .ruling-list { list-style: none; padding: 0; margin: 1.5rem 0; }
.check-list li { border-top: 1px solid var(--rule); }
.check-list a { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: 1rem 0; text-decoration: none; color: var(--ink); }
.check-list .name { font: 600 1.15rem var(--serif); }
.check-list .when { color: var(--ink-2); font-size: .85rem; }
.check-list .state { grid-column: 1 / -1; font-size: .9rem; color: var(--ink-2); }
.tally { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.pill { font-size: .8rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px; }
.pill.fix { background: var(--red-wash); color: var(--red); }
.pill.check { background: var(--ochre-wash); color: var(--ochre); }
.pill.tighten { background: var(--pencil-wash); color: var(--pencil); }
.pill.fine { background: var(--green-wash); color: var(--green); }

/* one check */
.head { margin-bottom: 1.5rem; }
.head .meta span + span::before { content: " · "; }
.progress { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem; margin: 1rem 0; }
.progress .stage { font-family: var(--serif); font-size: 1.1rem; }
.bar { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; margin: .8rem 0; }
.bar i { display: block; height: 100%; width: 30%; background: var(--ink); animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .bar i { animation: none; width: 100%; opacity: .3; } }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 .5rem; position: sticky; top: 4.2rem; background: var(--paper); padding: .5rem 0; z-index: 3; }
.filters button { border-radius: 99px; font-weight: 600; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tier-note { color: var(--ink-2); font-size: .9rem; margin: .25rem 0 1rem; max-width: 65ch; }

.item {
  background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--rule);
  border-radius: var(--radius); padding: 1rem 1.1rem; margin: .8rem 0;
}
.item.fix { border-left-color: var(--red); }
.item.check { border-left-color: var(--ochre); }
.item.tighten { border-left-color: var(--pencil); }
.item.decided-fix { box-shadow: inset 0 0 0 1px var(--green); }
.item.decided-fine { opacity: .7; }
.item .where { font-size: .8rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.item blockquote { margin: .4rem 0 .6rem; font: italic 1.08rem/1.5 var(--serif); }
.item blockquote::before { content: "“"; } .item blockquote::after { content: "”"; }
.item .kind { font-size: .8rem; font-weight: 600; }
.item.fix .kind { color: var(--red); } .item.check .kind { color: var(--ochre); } .item.tighten .kind { color: var(--pencil); }
.item p { margin: .3rem 0; }
.item .label { font-weight: 600; }
.sources { margin: .4rem 0; padding-left: 1.1rem; font-size: .9rem; }
.sources li { margin: .3rem 0; }
.sources q { color: var(--ink-2); }
.rewrite { margin-top: .7rem; }
.rewrite textarea { width: 100%; min-height: 3.2rem; border-color: var(--green); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.actions .done { font-weight: 600; font-size: .9rem; }
.actions .done.fix { color: var(--green); } .actions .done.fine { color: var(--ink-2); }
.note-box { display: flex; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.note-box input { flex: 1; min-width: 12rem; }
details.more { margin-top: .4rem; font-size: .9rem; }
details.more summary { cursor: pointer; color: var(--pencil); }

.fine-list { list-style: none; padding: 0; font-size: .92rem; }
.fine-list li { padding: .45rem 0; border-top: 1px solid var(--rule); }
.fine-list q { font-family: var(--serif); font-style: italic; }

/* bottom bar */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--ink); color: var(--paper);
  padding: .8rem clamp(1rem, 4vw, 3rem); display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  flex-wrap: wrap; z-index: 6;
}
.dock button { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.dock a { color: var(--paper); }

.result { background: var(--sheet); border: 1px solid var(--green); border-radius: var(--radius); padding: 1.2rem; margin: 1.5rem 0; }
.result textarea { width: 100%; min-height: 18rem; }
.result .problems { color: var(--red); }
.change { border-top: 1px solid var(--rule); padding: .6rem 0; font-size: .92rem; }
.change del { color: var(--red); text-decoration: line-through; background: var(--red-wash); }
.change ins { color: var(--green); text-decoration: none; background: var(--green-wash); }

.ruling-list li { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: .9rem 1rem; margin: .7rem 0; }
.ruling-list q { font: italic 1.02rem var(--serif); }
.ruling-list .meta { margin-top: .3rem; }
.downloads { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .9rem; margin: .5rem 0; }
