/* antislop — the copy-editor's desk.
   Concept: a manuscript being marked up. Dashes get the editor's red pen (the
   hard correction); phrase tics get the blue pencil (advisory). Space Mono is the
   machine voice; Newsreader is the human prose it judges. */

@font-face { font-family: "Space Mono"; src: url("./fonts/space-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("./fonts/space-mono-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("./fonts/newsreader-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("./fonts/newsreader-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("./fonts/newsreader-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --paper: #f4f2ea;
  --card: #fbfaf5;
  --ink: #1c1814;
  --ink-soft: #4b443c;
  --muted: #948c7e;
  --rule: #e3ded1;
  --pen: #c0271a;        /* editor's red: dashes, the hard gate, slop */
  --pen-bg: #f7dfdb;
  --pencil: #2b56a8;     /* blue pencil: phrase tics, advisory */
  --pencil-bg: #dde6f4;
  --clean: #2c7148;      /* the plain rewrite */
  --inverse: #1c1814;
  --inverse-ink: #efe8da;
  --mono: "Space Mono", ui-monospace, Menlo, Consolas, monospace;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 28px; }

/* ---- hero ---- */
.hero { padding: 84px 0 40px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--pen);
  margin: 0 0 22px;
}
.display {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.7rem, 8vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 14ch;
}
.lede {
  font-size: clamp(1.12rem, 2.2vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 26px 0 0;
}
.legend {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 28px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
}
.legend .key { color: var(--ink); }
.legend .swatch { display: inline-block; width: 22px; height: 0; vertical-align: middle; margin-right: 7px; }
.legend .swatch.pen { border-top: 3px solid var(--pen); }
.legend .swatch.pencil { border-top: 3px solid var(--pencil); }

/* ---- section labels ---- */
.sec-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 40px 0 12px;
  font-weight: 400;
}

/* ---- the desk / tool ---- */
.desk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
button {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 7px 13px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
button:disabled { opacity: 0.35; cursor: not-allowed; border-style: dashed; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--pencil); outline-offset: 2px; }

textarea#input {
  width: 100%;
  min-height: 190px;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink);
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 0;
  resize: vertical;
}
textarea#input:focus { outline: none; border-color: var(--ink); }

.summary { font-family: var(--mono); font-size: 0.82rem; min-height: 1.4em; margin: 12px 0 0; color: var(--ink-soft); }
.summary .pass { color: var(--clean); }
.summary .fail { color: var(--pen); }
.summary .muted, .muted { color: var(--muted); }
.summary b { font-weight: 700; }

/* the marked-up manuscript */
.output {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 22px 22px 24px;
  background: var(--card);
  border: 1px solid var(--rule);
  min-height: 56px;
}
.output .muted { font-family: var(--mono); font-size: 0.82rem; }

mark.hit { background: transparent; color: inherit; padding: 0 2px; border-radius: 2px; }
mark.dash {
  color: var(--pen);
  background: var(--pen-bg);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  padding-bottom: 1px;
}
mark.phrase {
  background: var(--pencil-bg);
  border-bottom: 2px solid var(--pencil);
  padding-bottom: 1px;
}

/* margin notes (findings) */
.findings { list-style: none; padding: 0; margin: 0; }
.findings .note {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.findings .note:first-child { border-top: none; }
.note-tag { font-family: var(--mono); font-size: 0.74rem; line-height: 1.45; }
.note.dash .note-tag { color: var(--pen); }
.note.phrase .note-tag { color: var(--pencil); }
.note-num { display: block; font-weight: 700; font-size: 0.82rem; }
.note-kind { display: block; letter-spacing: 0.03em; margin-top: 1px; }
.note-body b { font-family: var(--mono); font-weight: 700; font-size: 0.92rem; }
.note-count { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); margin-left: 6px; }
.note-spans { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.note-spans code {
  font-family: var(--mono); font-size: 0.78rem;
  background: var(--paper); border: 1px solid var(--rule);
  padding: 1px 6px;
}
.findings .clean-row { font-family: var(--mono); font-size: 0.82rem; color: var(--clean); padding: 14px 0; }

/* ---- catalogue ---- */
.catalogue-wrap { margin-top: 72px; }
.sec-title { font-family: var(--mono); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em; margin: 0; }
.note-lede { font-size: 1.02rem; color: var(--ink-soft); max-width: 58ch; margin: 12px 0 28px; }

.pat {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}
.pat-num { font-family: var(--mono); font-size: 0.95rem; color: var(--muted); }
.pat-title { font-family: var(--mono); font-weight: 700; font-size: 1.02rem; margin: 0; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pat-badge {
  font-family: var(--mono);
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  margin-left: auto;
  padding-top: 3px;
}
.pat.dash .pat-badge { color: var(--pen); }
.pat.phrase .pat-badge { color: var(--pencil); }
.pat.manual .pat-badge { color: var(--muted); }
.why { font-size: 1.0rem; color: var(--ink-soft); margin: 10px 0 0; max-width: 62ch; }
.eg { font-family: var(--mono); font-size: 0.8rem; line-height: 1.55; margin: 10px 0 0; padding-left: 12px; border-left: 2px solid var(--rule); }
.eg.slop { border-left-color: var(--pen); }
.eg.plain { border-left-color: var(--clean); }
.eg .tag { display: inline-block; width: 40px; color: var(--muted); text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.08em; }
.eg.slop .tag { color: var(--pen); }
.eg.plain .tag { color: var(--clean); }

/* ---- subscribe band ---- */
.subscribe { background: var(--inverse); color: var(--inverse-ink); margin-top: 80px; }
.subscribe .wrap { padding-top: 72px; padding-bottom: 76px; }
.accent-bar { width: 56px; height: 3px; background: var(--pen); margin-bottom: 26px; }
.subscribe-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0; max-width: 20ch; }
.subscribe-lede { font-size: 1.1rem; color: #c8c0b1; max-width: 44ch; margin: 18px 0 0; }
.cta {
  display: inline-block;
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.04em;
  margin-top: 30px;
  padding: 12px 22px;
  background: var(--pen); color: #fff;
  text-decoration: none;
  transition: opacity 0.15s;
}
.cta:hover { opacity: 0.88; }

/* ---- footer ---- */
footer.wrap { padding-top: 36px; padding-bottom: 72px; color: var(--muted); font-family: var(--mono); font-size: 0.78rem; line-height: 1.7; }
footer a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); transition: border-color 0.15s; }
footer a:hover { border-color: var(--ink); }

/* ---- motion / a11y ---- */
@media (max-width: 560px) {
  .pat, .findings .note { grid-template-columns: 1fr; gap: 6px; }
  .pat-badge { margin-left: 0; }
}
.hero > .wrap > * { animation: rise 0.5s cubic-bezier(0.2, 0.6, 0.2, 1) both; }
.hero .display { animation-delay: 0.04s; }
.hero .lede { animation-delay: 0.1s; }
.hero .legend { animation-delay: 0.16s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero > .wrap > * { animation: none; }
  * { transition: none !important; }
}
