/* Figleaf — shared stylesheet for every server-rendered page.
   Palette and type are the original site's: off-white, near-black, one red,
   Helvetica. Structure comes from rules and a margin column, not boxes. */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f2f2f2;
  --ink: #1a1a1a;
  --ink-2: #444444;
  --ink-3: #737373;
  --line: #e0e0e0;
  --line-strong: #c4c4c4;
  --accent: #c0392b;
  --accent-ink: #ffffff;
  --accent-soft: #fdecea;
  --ok: #2e7d32;
  --ok-soft: #e8f5e9;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --inverse-bg: #1a1a1a;
  --inverse-ink: #e0e0e0;
  --inverse-ink-2: #999999;
  --gutter: 132px;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3, h4, p, ul, ol, dl, figure, blockquote { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
code { background: #eeeeee; padding: 0.1em 0.35em; border-radius: 2px; }
.not { color: var(--accent); font-weight: 700; }
.muted { color: var(--ink-3); }
.small { font-size: 0.875rem; }
[hidden] { display: none !important; }

/* Layout ------------------------------------------------------------ */

.page { max-width: 1060px; margin: 0 auto; padding: 0 28px 72px; }
.page.narrow { max-width: 700px; }
.page.slim { max-width: 520px; }

.nav {
  display: flex; align-items: baseline; gap: 22px;
  padding: 26px 0 14px; margin-bottom: 56px;
  border-bottom: 2px solid var(--ink);
  font-size: 0.85rem;
}
.nav .logo { font-size: 1.2rem; font-weight: 700; color: var(--ink); margin-right: auto; letter-spacing: -0.01em; }
.nav .logo:hover { text-decoration: none; }
.nav a.link { color: var(--ink-3); }
.nav a.link:hover { color: var(--accent); text-decoration: none; }
.nav a.link[aria-current="page"] { color: var(--ink); box-shadow: 0 16px 0 -14px var(--accent); }
.nav .who { color: var(--ink-3); font-size: 0.8rem; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 700;
  color: var(--ok); text-transform: lowercase;
}
.pill::before { content: "["; } .pill::after { content: "]"; }
@media (max-width: 640px) {
  .nav { gap: 14px; flex-wrap: wrap; margin-bottom: 32px; }
  .nav .who { display: none; }
}

.footer {
  margin-top: 88px; padding-top: 14px; border-top: 1px solid var(--line-strong);
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  font-size: 0.8rem; color: var(--ink-3);
}
.footer a { color: var(--ink-3); }
.footer a:hover { color: var(--accent); }
.footer .spacer { margin-left: auto; }

/* A section is a margin mark plus a body. The mark sticks while you read. */
.row { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); margin-top: 84px; }
.row > .mark {
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3);
  position: sticky; top: 20px; align-self: start; padding-top: 5px;
}
.row > .mark b { color: var(--accent); font-weight: 700; }
@media (max-width: 760px) {
  .row { grid-template-columns: 1fr; margin-top: 60px; }
  .row > .mark { position: static; margin-bottom: 10px; }
}

/* Type -------------------------------------------------------------- */

.display {
  font-weight: 800;
  font-size: clamp(2.5rem, 7.4vw, 5.2rem);
  line-height: 0.98; letter-spacing: -0.04em;
}
.display em { font-style: normal; color: var(--accent); }
.title { font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.05; letter-spacing: -0.03em; }
.heading { font-weight: 800; font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.02em; }
.lede { font-size: 1.08rem; color: var(--ink-2); line-height: 1.55; max-width: 33em; }
.eyebrow { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); }
.eyebrow.accent { color: var(--accent); }
.section { margin-top: 64px; }
.section-head { margin-bottom: 26px; }
.section-head .lede { margin-top: 10px; }

/* Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 3px;
  border: 1px solid var(--ink); cursor: pointer;
  font-size: 0.9rem; font-weight: 600; line-height: 1.2;
  background: var(--ink); color: var(--inverse-ink);
}
.btn:hover { text-decoration: none; background: #333; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: #a93226; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; }
.btn.block { display: flex; width: 100%; }
.btn.sm { padding: 5px 11px; font-size: 0.78rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* "Cards" are ruled entries, not boxes ------------------------------ */

.card { border-top: 1px solid var(--ink); padding: 14px 0 0; }
.card h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; margin-bottom: 5px; }
.card p { font-size: 0.92rem; color: var(--ink-2); }
.card.raised, .card.boxed { background: var(--surface); border: 1px solid var(--ink); padding: 22px; }
.card.inverse { background: var(--inverse-bg); border: 0; color: var(--inverse-ink); padding: 24px; }
.card.inverse h3 { color: #fff; }
.card.inverse p { color: var(--inverse-ink-2); }
.card.inverse .btn.accent { border-color: var(--accent); }
.card.inverse .btn.ghost { border-color: #555; color: var(--inverse-ink) !important; }
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; border-top-color: var(--accent); }
a.card:hover h3 { color: var(--accent); }
a.card h3::after { content: " \2192"; color: var(--accent); }

.grid { display: grid; gap: 30px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }

/* Numbered claims: number, claim, and the argument set off to the right */
.claims { list-style: none; padding: 0; counter-reset: claim; border-bottom: 1px solid var(--ink); }
.claims li {
  counter-increment: claim;
  display: grid; grid-template-columns: 44px minmax(0, 5fr) minmax(0, 7fr); gap: 0 24px;
  padding: 20px 0; border-top: 1px solid var(--ink); align-items: baseline;
}
.claims li::before { content: counter(claim); font-family: var(--mono); font-size: 0.8rem; color: var(--accent); font-weight: 700; }
.claims.lettered li::before { content: counter(claim, lower-alpha); }
.claims h3 { font-size: 1.22rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.claims p { font-size: 0.97rem; color: var(--ink-2); }
@media (max-width: 760px) {
  .claims li { grid-template-columns: 28px 1fr; }
  .claims p { grid-column: 2; margin-top: 6px; }
}

.aside-bar {
  background: var(--inverse-bg); color: #fff;
  margin-top: 36px; padding: 30px 32px;
  display: grid; grid-template-columns: auto 1fr; gap: 8px 28px; align-items: baseline;
}
.aside-bar .eyebrow { color: #888; }
.aside-bar blockquote { font-size: clamp(1.15rem, 2.4vw, 1.55rem); font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; }
.aside-bar blockquote span { color: #8c8c8c; }
@media (max-width: 760px) { .aside-bar { grid-template-columns: 1fr; padding: 24px; } }

.linklist { border-bottom: 1px solid var(--ink); }
.linklist a {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr) auto; gap: 0 24px; align-items: baseline;
  padding: 16px 0; border-top: 1px solid var(--ink); color: var(--ink);
}
.linklist a:hover { text-decoration: none; color: var(--accent); }
.linklist strong { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; }
.linklist span { color: var(--ink-2); font-size: 0.95rem; }
.linklist i { font-style: normal; color: var(--accent); font-family: var(--mono); }
@media (max-width: 760px) { .linklist a { grid-template-columns: 1fr auto; } .linklist span { grid-column: 1; } }

/* Forms ------------------------------------------------------------- */

.field-label { display: block; font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); margin-bottom: 6px; }
.input, .textarea {
  width: 100%; background: var(--bg); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 2px;
  padding: 11px 13px; font-size: 1rem; line-height: 1.5;
}
.textarea { resize: vertical; min-height: 84px; }
.input::placeholder, .textarea::placeholder { color: #aaaaaa; }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); }

.dial { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dial-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.85rem; font-weight: 700; }
.dial-head output { font-family: var(--mono); color: var(--accent); }
.dial-hint { font-size: 0.8rem; color: var(--ink-3); line-height: 1.4; min-height: 1.4em; }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 2px 0; }

.notice { padding: 11px 14px; font-size: 0.9rem; border-left: 3px solid; }
.notice.error { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.notice a { font-weight: 700; text-decoration: underline; }

.spinner {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.receipt-link {
  font-family: var(--mono); font-size: 0.8em; white-space: nowrap;
  color: var(--accent); border-bottom: 1px dotted var(--accent);
}
.receipt-link:hover { text-decoration: none; background: var(--accent-soft); }

/* Landing ----------------------------------------------------------- */

.hero .display { max-width: 12em; }
.hero-lower { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); margin-top: 34px; }
.hero-lower .mark { font-family: var(--mono); font-size: 4.2rem; line-height: 0.8; color: var(--accent); font-weight: 700; }
.hero .btn-row { margin-top: 24px; }
.hero-note { margin-top: 12px; font-size: 0.82rem; color: var(--ink-3); }
@media (max-width: 760px) { .hero-lower { grid-template-columns: 1fr; } .hero-lower .mark { display: none; } }

/* The ledger: what was written on the left, what went out on the right */
.specimen { margin-top: 64px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.specimen-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: 190px; transition: opacity 0.3s ease; }
.specimen-body.fading { opacity: 0; }
.specimen-row { padding: 20px 28px 24px 0; }
.specimen-row + .specimen-row { border-left: 1px solid var(--ink); padding: 20px 0 24px 28px; }
.specimen-row .eyebrow { margin-bottom: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.specimen .orig { color: var(--ink-3); font-size: 1.05rem; line-height: 1.5; }
.specimen .blur { font-size: 1.28rem; font-weight: 500; line-height: 1.42; letter-spacing: -0.01em; }
.chip { color: var(--ink-3); }
.chip::before { content: "("; } .chip::after { content: ")"; }
.specimen-nav {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 0; border-top: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: 0.76rem; color: var(--ink-3);
}
.specimen-nav .count { margin-right: auto; }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--ink); font-size: 1rem; padding: 2px 6px; }
.icon-btn:hover { color: var(--accent); }
@media (max-width: 760px) {
  .specimen-body { grid-template-columns: 1fr; }
  .specimen-row { padding: 18px 0; }
  .specimen-row + .specimen-row { border-left: 0; border-top: 1px solid var(--line-strong); padding: 18px 0; }
}

/* Try-it box -------------------------------------------------------- */

.try .textarea { font-size: 1.05rem; }
.try-controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: 26px; align-items: end; margin-top: 16px; }
@media (max-width: 720px) { .try-controls { grid-template-columns: 1fr; gap: 14px; } .try-controls .btn { width: 100%; } }
details.context { margin-top: 14px; font-size: 0.88rem; }
details.context summary { cursor: pointer; color: var(--ink-3); width: fit-content; }
details.context summary:hover { color: var(--accent); }
details.context .grid { margin-top: 12px; gap: 16px; }
details.context .textarea { font-size: 0.9rem; min-height: 72px; }

.result { margin-top: 18px; border-top: 1px dashed var(--line-strong); padding-top: 16px; }
.result-text { font-size: 1.2rem; font-weight: 500; line-height: 1.45; letter-spacing: -0.01em; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.result-actions .meta { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); margin-right: auto; }

/* Compose ----------------------------------------------------------- */

.persona-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 18px; }
.persona { border: 0; background: none; padding: 2px 0; font-size: 0.88rem; color: var(--ink-3); cursor: pointer; border-bottom: 1px solid transparent; }
.persona:hover { color: var(--accent); }
.persona[aria-pressed="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.log { display: flex; flex-direction: column; gap: 26px; margin-top: 18px; }
.log:empty::before { content: "Nothing yet. Your blurs will pile up here."; color: var(--ink-3); font-size: 0.92rem; }
.log .orig { color: var(--ink-3); font-size: 0.95rem; }

/* Steps ------------------------------------------------------------- */

.steps { counter-reset: step; }
.card.steps { border-top: 0; padding: 0; }
.step { position: relative; padding: 16px 0 16px 44px; border-top: 1px solid var(--ink); }
.steps .step:last-child { border-bottom: 1px solid var(--ink); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 19px;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 700; color: var(--accent);
}
.step h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 2px; }
.step p { font-size: 0.94rem; color: var(--ink-2); }
.step p + p { margin-top: 4px; }

.codebox {
  background: var(--inverse-bg); color: var(--inverse-ink);
  padding: 14px 16px; margin: 10px 0;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.6;
  overflow-x: auto; white-space: pre;
}
.codebox em { font-style: normal; color: #4ade80; }

/* Pricing ----------------------------------------------------------- */

.plan { border: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); padding: 24px; background: var(--surface); }
.plan.featured { border: 2px solid var(--ink); }
.price { font-size: 3.4rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.price small { font-size: 0.9rem; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.ticks { list-style: none; padding: 0; margin: 18px 0 22px; font-size: 0.93rem; color: var(--ink-2); }
.ticks li { padding: 7px 0 7px 22px; position: relative; border-top: 1px solid var(--line); }
.ticks li::before { content: "\00ac"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* Receipt (verify page): printed paper with a torn edge -------------- */

.verdict { background: var(--inverse-bg); color: #fff; padding: 26px 28px; max-width: 560px; margin: 0 auto; }
.verdict .eyebrow { color: #888 !important; opacity: 1 !important; }
.verdict .title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.verdict .title em { font-style: normal; color: #ff6b57; }
.verdict .title strong { font-weight: 800; }
.verdict p { margin-top: 12px; color: var(--inverse-ink-2); font-size: 0.93rem; max-width: 40em; }
.verdict.bad { background: var(--accent); }
.verdict.bad .eyebrow { color: #f3c4bd !important; }
.verdict.bad p { color: #fbe3df; }
.verdict.bad code { background: rgba(0, 0, 0, 0.2); }

.receipt {
  position: relative; background: var(--surface); margin: 22px auto 0; max-width: 560px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.07));
  padding-bottom: 12px;
}
.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background:
    linear-gradient(-45deg, transparent 7px, var(--surface) 0) 0 0 / 14px 10px repeat-x,
    linear-gradient(45deg, transparent 7px, var(--surface) 0) 0 0 / 14px 10px repeat-x;
  transform: scaleY(-1);
}
.receipt-part { padding: 18px 26px; }
.receipt-part + .receipt-part { border-top: 1px dashed var(--line-strong); }
.receipt-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 0.76rem; color: var(--ink-3); }
.receipt-text { font-size: 1.15rem; font-weight: 500; line-height: 1.5; margin-top: 12px; overflow-wrap: anywhere; }
.checks { list-style: none; padding: 0; margin: 12px 0 0; }
.checks li { display: grid; grid-template-columns: 30px 1fr; gap: 6px; }
.checks li + li { margin-top: 14px; }
.checks .mark { font-family: var(--mono); font-size: 0.8rem; font-weight: 700; padding-top: 2px; }
.checks .mark::before { content: "["; } .checks .mark::after { content: "]"; }
.checks .yes .mark { color: var(--ok); }
.checks .no .mark { color: var(--accent); }
.checks .meh .mark { color: var(--warn); }
.checks strong { display: block; font-size: 0.95rem; line-height: 1.4; }
.checks span.why { display: block; font-size: 0.85rem; color: var(--ink-3); margin-top: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 18px; font-family: var(--mono); font-size: 0.78rem; margin-top: 10px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-2); text-align: right; }
details.tech summary { cursor: pointer; font-family: var(--mono); font-size: 0.76rem; color: var(--ink-3); }
details.tech .kv dd { text-align: left; }
details.tech pre {
  background: var(--surface-2); padding: 12px;
  font-family: var(--mono); font-size: 0.72rem; overflow-x: auto; margin: 10px 0 0; color: var(--ink-2);
}

/* Prose (terms) ----------------------------------------------------- */

.prose h1 { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 14px; }
.prose h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin: 44px 0 10px; padding-top: 14px; border-top: 1px solid var(--ink); }
.prose h3 { font-size: 1rem; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--ink-2); font-size: 0.95rem; }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 14px; }
.prose li + li { margin-top: 6px; }
.prose strong { color: var(--ink); }

/* Status pages ------------------------------------------------------ */

.center-stage { min-height: 64vh; display: flex; align-items: center; }
.center-stage .lede { margin-top: 12px; }
.center-stage .btn-row { justify-content: flex-start !important; }

/* Tables (admin) ---------------------------------------------------- */

.table-wrap { overflow-x: auto; }
.card.table-wrap { border-top: 2px solid var(--ink); padding-top: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
table.data th { text-align: left; font-family: var(--mono); font-size: 0.72rem; font-weight: 400; color: var(--ink-3); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line-strong); }
table.data td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.stat { font-size: 2.6rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.04em; }

.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; background: #cccccc; border-radius: 26px; transition: background 0.15s; pointer-events: none; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
