/* torc.art core — the shared galley chrome: reset, base typography, the
   mono meta voice, job-ticket header, footer, forms, buttons, notices.
   Extracted 2026-07-21 from the hand-synced prefix of the members and
   subbin stylesheets (union of both, so a few selectors only one app
   uses live here — harmless where unmatched). Per-app layers build on
   top; tokens come from tokens.css. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg); /* flat paper; the press prints one tone */
  color: var(--ink);
  font-family: var(--font-serif), ui-serif, Georgia, "Times New Roman", serif;
  font-size: var(--step-0);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}

/* ---- the mono meta voice: slug lines, labels, nav ---- */

.mono,
.eyebrow,
figcaption,
.embed-link,
.nav-list a,
.footer-nav a,
.admin-nav,
.badge {
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.site-header,
main,
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-m);
}
.site-header { padding-top: var(--space-l); }
main          { padding-top: var(--space-xs); padding-bottom: var(--space-l); }
.site-footer {
  margin-top: var(--space-xl);
  padding-bottom: var(--space-xl);
  color: var(--muted);
}

main.wide { max-width: 92ch; }

/* ---- nav: the job ticket ---- */

nav.site-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-s);
  line-height: 1.2;
  border-top: 2px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0;
}

.site-title a {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.site-title a:hover,
.site-title a:focus-visible { color: var(--accent); }
.site-title .binary-name {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: var(--space-3xs);
}
.site-title .binary-name::before { content: "/ "; color: var(--muted); }

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-s);
  margin-left: auto;
  justify-content: flex-end;
}
.nav-list a {
  font-size: var(--step--1);
  color: var(--ink);
  text-decoration: none;
}
.nav-list a:hover,
.nav-list a:focus-visible { color: var(--accent); }

/* ---- footer: the imprint ---- */

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-s);
  padding: 0.6rem 0;
  border-bottom: 2px solid var(--rule);
}
.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--step--2);
}
.footer-nav a:hover,
.footer-nav a:focus-visible { color: var(--accent); }
.site-footer .fineprint {
  font-family: var(--font-serif), serif;
  font-style: italic;
  letter-spacing: normal;
  text-transform: none;
  padding-top: var(--space-xs);
}

/* ---- prose ---- */

h1, h2, h3, h4 {
  font-family: var(--font-serif), serif;
  letter-spacing: 0.01em;
  margin: var(--space-l) 0 var(--space-s);
  line-height: 1.15;
}
h1 { font-size: var(--step-3); font-weight: 400; line-height: 1.1; margin-top: var(--space-l); }
h2 { font-size: var(--step-2); font-weight: 400; }
h3 { font-size: var(--step-1); font-weight: 600; }
h4 { font-weight: 600; }

p { margin: 0 0 var(--space-s); }

.lede,
.home-deck {
  color: var(--muted);
  font-style: italic;
  font-size: var(--step-1);
  max-width: 52ch;
  margin: 0 0 var(--space-m);
}
.lede strong { font-style: normal; font-weight: 600; }

.eyebrow {
  font-size: var(--step--2);
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 var(--space-2xs);
}

/* Fine print is sentence-length prose (consent lines, hints, empty
   states) — the mono voice at reading case, not the uppercase shout of
   labels and nav. Refined 2026-07-21; .site-footer .fineprint still
   overrides to serif italic for the imprint line. */
.fineprint {
  font-family: var(--mono);
  color: var(--muted);
  font-size: var(--step--2);
  letter-spacing: 0.02em;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover,
a:focus-visible { color: var(--accent); }

ul, ol { padding-left: 1.2rem; margin: 0 0 var(--space-s); }
li { margin: 0.2rem 0; }

blockquote {
  margin: var(--space-m) 0;
  padding-left: var(--space-s);
  border-left: 2px solid var(--line);
  color: var(--muted);
}

hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-l) 0; }

code, pre, kbd, samp {
  font-family: var(--mono);
  background: var(--bg-accent);
  padding: 0.1rem 0.35rem;
  font-size: 0.95em;
}
pre { padding: var(--space-s); overflow-x: auto; line-height: 1.5; }
pre code { background: transparent; padding: 0; }

img, video, iframe { max-width: 100%; height: auto; }

figure { margin: var(--space-m) 0; }
figcaption {
  font-size: var(--step--2);
  color: var(--muted);
  margin-top: var(--space-2xs);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-m) 0;
  font-size: var(--step--1);
}
th {
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
/* The ledger head: a full-weight rule under the column labels, hairlines
   between rows (the oeuvre ledger's idiom, unified 2026-07-21). */
th { border-bottom: 2px solid var(--rule); }

/* ---- forms ---- */

form {
  display: grid;
  gap: var(--space-s);
  margin: var(--space-s) 0 var(--space-m);
}
form.inline { display: inline; margin: 0; gap: 0; }

label {
  display: grid;
  gap: var(--space-3xs);
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=url],
input[type=search],
textarea,
select {
  font: inherit;
  font-family: var(--font-serif), serif;
  letter-spacing: normal;
  text-transform: none;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink);
  border-radius: 0;
  width: 100%;
}
textarea { resize: vertical; min-height: 8rem; line-height: 1.5; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
input[type=file] {
  width: 100%;
  font: inherit;
  font-family: var(--mono);
  padding: 0.4rem 0;
}

/* Buttons are set like the rest of the meta voice: mono, a single
   hairline of ink, and they invert on press — type meeting paper. */
button, .button {
  font-family: var(--mono);
  font-style: normal; /* don't inherit italic from .lede etc. */
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink);
  padding: 0.5rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
}
button:hover, .button:hover,
button:focus-visible, .button:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

button.secondary, .button.secondary { border-color: var(--line); color: var(--muted); }
button.secondary:hover, .button.secondary:hover {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

button.danger, .button.danger,
form.danger button {
  background: transparent;
  color: var(--error);
  border-color: var(--error);
}
button.danger:hover, .button.danger:hover,
form.danger button:hover { background: var(--error); color: #fff; }
button.danger.small { padding: 0.2rem 0.6rem; font-size: var(--step--2); }

.error {
  border-left: 3px solid var(--error);
  padding: 0.6rem 0.9rem;
  background: var(--error-bg);
  color: var(--error);
  font-size: var(--step--1);
}
.notice {
  border-left: 3px solid var(--notice);
  padding: 0.6rem 0.9rem;
  background: var(--notice-bg);
  color: var(--notice);
  font-size: var(--step--1);
}

/* Honeypot: visually hidden but not display:none (some bots skip those). */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Request-pending state (htmx adds .htmx-request to the element that
   fired the request — a boosted form during submit). Quiets the buttons
   and blocks the double-click; harmless on binaries without htmx. */
.htmx-request button[type=submit], button[type=submit].htmx-request {
  opacity: 0.55;
  cursor: progress;
  pointer-events: none;
}

.badge {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.1rem 0.55rem;
  font-size: var(--step--2);
}
.badge-on { border-color: var(--accent); color: var(--accent); }
