:root {
  --bg: #fbf7f2;
  --fg: #2a211c;
  --muted: #6b5d55;
  --meat: #b8342a;
  --meat-bg: #f7e1dc;
  --meat-on: #fff6f3;
  --grudge: #3d3a8c;
  --grudge-bg: #e2e1f5;
  --grudge-on: #f4f3ff;
  --card: #ffffff;
  --border: #e4d9cf;
  --field: #d8ccc1;
  --stamp-out: #b0291c;
  --stamp-ok: #22704a;
  --serif: "Fraunces", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1513;
    --fg: #f1e9e3;
    --muted: #b3a398;
    --meat: #ff8a7a;
    --meat-bg: #3a1f1b;
    --meat-on: #2a0f0b;
    --grudge: #b3afff;
    --grudge-bg: #24223f;
    --grudge-on: #15133a;
    --card: #241d1a;
    --border: #3b302b;
    --field: #4a3d37;
    --stamp-out: #ff6b5b;
    --stamp-ok: #5fd08f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.55 "Lato", system-ui, -apple-system, sans-serif;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 72px; height: 72px; }

/* Site header on inner pages */
.site-header { padding: 20px 16px; text-align: center; background: var(--grudge-bg); }
.site-header.meat { background: var(--meat-bg); }
.site-header a { font-family: var(--serif); font-weight: 700; font-size: 20px; text-decoration: none; color: var(--grudge); }
.site-header.meat a { color: var(--meat); }

/* Home: the fork */
.fork { display: flex; flex-wrap: wrap; min-height: 640px; }
.side {
  flex: 1 1 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 64px 24px;
}
.meat { background: var(--meat-bg); color: var(--meat); }
.grudge { background: var(--grudge-bg); color: var(--grudge); }
.side h2 { font-size: clamp(2.5rem, 5vw, 3.5rem); margin: 8px 0 0; letter-spacing: -0.01em; }
.side p { color: var(--fg); margin: 0; font-size: 18px; }
.side .gloss { color: inherit; font-style: italic; }

.button, button {
  display: inline-block;
  min-height: 44px;
  margin-top: 20px;
  padding: 12px 28px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: var(--fg);
  color: var(--bg);
}
.meat .button { background: var(--meat); color: var(--meat-on); }
.grudge .button, .narrow.grudge-page button[type="submit"] { background: var(--grudge); color: var(--grudge-on); }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 400; text-decoration: underline; }
button.danger { color: var(--stamp-out); }

.side .tally { margin-top: 16px; font-size: 15px; color: inherit; }
.side .tally strong { font-family: var(--serif); font-size: 18px; }

.definitions { max-width: 640px; margin: 32px auto 48px; padding: 0 16px; }
.definitions .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.definitions h3 { margin: 0 0 8px; font-size: 24px; }
.definitions p.sense { margin: 0 0 8px; padding-left: 12px; font-style: italic; border-left: 4px solid var(--meat); }
.definitions p.sense + p.sense { border-left-color: var(--grudge); }
.definitions .source { margin: 4px 0 0 16px; font-size: 14px; color: var(--muted); }
.definitions .source a { color: inherit; text-decoration-color: var(--border); text-underline-offset: 3px; }
.definitions .source a:hover { color: var(--fg); text-decoration-color: currentColor; }
.definitions .source::before { content: "— "; }

/* Forms and beef pages */
.narrow { width: 100%; max-width: 576px; margin: 0 auto; padding: 48px 16px; }
.narrow h1 { font-size: clamp(2.2rem, 6vw, 2.75rem); margin: 0 0 16px; }
.grudge-page h1 { color: var(--grudge); }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; margin: 18px 0; }
.hint { font-weight: 400; color: var(--muted); font-size: 15px; }
input, textarea {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 400;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--field);
  border-radius: 10px;
}
textarea { resize: vertical; }
.copy { font-family: ui-monospace, monospace; font-size: 0.85em; cursor: copy; }
.copy-field { display: flex; gap: 8px; align-items: stretch; margin: 8px 0 20px; }
.copy-field .copy { flex: 1 1 auto; min-width: 0; transition: border-color 0.2s, background-color 0.2s; }
.copy-field .copy-button { margin: 0; flex: 0 0 auto; min-width: 96px; padding: 0 18px; border-radius: 10px; background: var(--grudge); color: var(--grudge-on); transition: background-color 0.2s; }
.copy-field.copied .copy { border-color: var(--stamp-ok); }
.copy-field.copied .copy-button { background: var(--stamp-ok); color: var(--bg); }
.error { background: var(--meat-bg); color: var(--meat); padding: 10px 14px; border-radius: 10px; }

.beef .stamp {
  display: inline-block;
  margin: 0 0 24px;
  transform: rotate(-6deg);
  border: 4px solid currentColor;
  border-radius: 6px;
  padding: 4px 16px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.is-outstanding .stamp { color: var(--stamp-out); }
.is-settled .stamp { color: var(--stamp-ok); }
.beef .body { white-space: pre-wrap; font-size: 18px; }
.byline { color: var(--muted); }
.settle { margin-top: 32px; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.settle label { margin-top: 0; }
.settled {
  margin: 32px 0;
  padding: 40px 24px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.settled .icon { width: 64px; height: 64px; }
.settled .verdict { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 28px; line-height: 1.2; }
.settled blockquote { margin: 8px 0 0; color: var(--fg); font-style: italic; font-size: 18px; }
.settled .button { margin-top: 8px; }
.actions { margin-top: 24px; }

.steaks {
  margin: 32px 16px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 14px;
  color: var(--muted);
  font-size: 15px;
}
.steaks .term { white-space: nowrap; }
.steaks strong { font-family: var(--serif); font-size: 28px; margin-right: 4px; }
.steaks .meat-term strong { color: var(--meat); }
.steaks .grudge-term strong { color: var(--grudge); }
.steaks .total { color: var(--fg); }
.steaks .total strong { font-size: 34px; color: var(--fg); }
.steaks .op { font-family: var(--serif); font-weight: 700; font-size: 28px; color: var(--fg); }
.steaks .total .op { margin-right: 10px; }

.mine-link { margin-top: 12px; font-size: 15px; }
.side .mine-link a { color: inherit; }
.mine-list { list-style: none; padding: 0; margin: 24px 0; display: flex; flex-direction: column; gap: 12px; }
.mine-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.mine-item a { flex: 1 1 240px; font-weight: 700; }
.mini-stamp { border: 2px solid currentColor; border-radius: 4px; padding: 0 6px; font-size: 12px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.mini-stamp.is-outstanding { color: var(--stamp-out); }
.mini-stamp.is-settled { color: var(--stamp-ok); }

.meta-link { color: inherit; text-decoration-color: var(--border); text-underline-offset: 3px; }
.meta-link:hover { text-decoration-color: currentColor; }

footer { margin-top: auto; text-align: center; color: var(--muted); font-size: 14px; padding: 24px 16px; border-top: 1px solid var(--border); }

@media (max-width: 640px) {
  .definitions .pair { grid-template-columns: minmax(0, 1fr); }
}
