@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Outfit:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --paper: #f3ead9;
  --paper-2: #ebe1cc;
  --ink: #1b1410;
  --ink-soft: #3a2e28;
  --oxblood: #7a1f2b;
  --oxblood-deep: #5c1620;
  --gold: #c4a46a;
  --gold-soft: #e6d5aa;
  --mute: #7a6a58;
  --line: #d9cbb3;
  --card: #fffaf1;
  --radius: 2px;
}

* { box-sizing: border-box; }
html {
  background: var(--paper);
  color: var(--ink);
  font-family: Outfit, system-ui, sans-serif;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    repeating-linear-gradient(90deg, transparent 0 31px, #d9cbb314 31px 32px),
    radial-gradient(circle at 8% -10%, #e6d5aa55, transparent 28rem),
    var(--paper);
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }
.shell { width: min(1120px, calc(100% - 40px)); margin: auto; }

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: Fraunces, Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font: 700 16px Fraunces, serif;
  position: relative;
}
.brand-mark:after {
  content: "";
  position: absolute;
  right: -3px;
  top: -3px;
  width: 8px;
  height: 8px;
  background: var(--gold);
}
.nav { display: flex; gap: 26px; font-size: 13px; font-weight: 600; }
.nav a { text-decoration: none; }
.nav a:hover, .nav a.active { color: var(--oxblood); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink);
  background: var(--oxblood);
  color: var(--paper);
  padding: 11px 18px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.btn:hover { background: var(--oxblood-deep); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 8px 13px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: default; }

.eyebrow {
  font-family: IBM Plex Mono, ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 64px;
  align-items: center;
  padding: 88px 0 72px;
  min-height: 640px;
}
.landing-hero h1 {
  font-family: Fraunces, Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 16px 0 22px;
}
.landing-hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--oxblood);
}
.hero-copy {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 540px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

.sheet-stack {
  position: relative;
  height: 420px;
}
.sheet {
  position: absolute;
  width: min(320px, 100%);
  height: 380px;
  background: var(--card);
  border: 1px solid var(--ink);
  padding: 22px;
  box-shadow: 12px 16px 0 var(--gold-soft);
}
.sheet.jacket { left: 36px; top: 18px; transform: rotate(4deg); background: var(--ink); color: var(--paper); box-shadow: 12px 16px 0 var(--oxblood); }
.sheet.book { left: 78px; top: 48px; transform: rotate(-3.5deg); z-index: 2; }
.sheet.article { left: 0; top: 0; transform: rotate(1.2deg); z-index: 3; }
.sheet .kicker { font: 500 10px/1 IBM Plex Mono, monospace; letter-spacing: 0.16em; text-transform: uppercase; color: var(--oxblood); }
.jacket .kicker { color: var(--gold); }
.sheet h3 { font-family: Fraunces, serif; font-size: 28px; line-height: 1.05; margin: 18px 0 12px; }
.sheet p { font-size: 13px; color: var(--mute); margin: 0; }
.jacket p { color: #cbb8a4; }
.sheet .bars { margin-top: 22px; display: grid; gap: 8px; }
.sheet .bars i { display: block; height: 6px; background: var(--line); }
.jacket .bars i { background: #3a2e28; }

.signup {
  display: flex;
  gap: 0;
  max-width: 460px;
  border: 1px solid var(--ink);
  background: var(--card);
}
.signup input {
  flex: 1;
  min-width: 160px;
  border: 0;
  background: transparent;
  padding: 13px 14px;
  outline: none;
  color: var(--ink);
}
.signup button { border: 0; border-left: 1px solid var(--ink); }
.signup-note { font-size: 13px; color: var(--mute); margin-top: 10px; min-height: 18px; }
.signup-note.ok { color: #2c4a3e; }
.signup-note.err { color: var(--oxblood); }

.rule-band {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--oxblood);
  color: var(--paper);
}
.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  min-height: 96px;
}
.rule-grid > * {
  margin: 0;
  padding: 22px 28px;
  border-left: 1px solid #ffffff2b;
  font-family: Fraunces, serif;
  font-size: 18px;
  font-weight: 500;
}
.rule-grid > *:first-child { border-left: 0; padding-left: 0; }
.rule-grid strong { font-size: 22px; font-weight: 700; }

.section { padding: 96px 0; }
.section h2 {
  font-family: Fraunces, Georgia, serif;
  font-optical-sizing: auto;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 12px 0 14px;
}
.lead { color: var(--mute); max-width: 560px; line-height: 1.7; }

.three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 42px;
}
.three article {
  background: var(--card);
  border: 1px solid var(--ink);
  padding: 24px;
  min-height: 220px;
}
.three .n {
  font: 500 11px IBM Plex Mono, monospace;
  color: var(--oxblood);
  letter-spacing: 0.12em;
}
.three h3 { font-family: Fraunces, serif; font-size: 26px; margin: 14px 0 10px; }
.three p { color: var(--mute); font-size: 14px; line-height: 1.6; margin: 0; }
.three code {
  display: block;
  margin-top: 18px;
  font: 400 11px/1.6 IBM Plex Mono, monospace;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
}

.hosts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 36px; }
.host-card {
  background: var(--card);
  border: 1px solid var(--ink);
  padding: 28px;
}
.host-card > span { font: 500 11px IBM Plex Mono, monospace; letter-spacing: 0.14em; text-transform: uppercase; color: var(--oxblood); }
.host-card h3 { font-family: Fraunces, serif; font-size: 30px; margin: 12px 0 10px; }
.host-card h3 a { text-decoration: none; }
.host-card h3 a:hover { color: var(--oxblood); }
.host-card p { color: var(--mute); line-height: 1.65; margin: 0 0 16px; }
.host-card .text-link { font-weight: 700; font-size: 13px; }

.api-band { background: var(--ink); color: var(--paper); padding: 88px 0; }
.api-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.api-band h2 { color: var(--paper); }
.api-band p { color: #cbb8a4; line-height: 1.7; max-width: 480px; }
.api-band .eyebrow { color: var(--gold); }
.api-band pre {
  margin: 0;
  background: #120e0c;
  border: 1px solid #3a2e28;
  padding: 24px;
  font: 400 12px/1.85 IBM Plex Mono, monospace;
  color: #f3ead9;
  overflow: auto;
}
.code-muted { color: #8a6e62; }
.kw { color: var(--gold); }

.invite {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  padding: 80px 0 40px;
}
.invite h2 { margin-bottom: 0; }

footer.site {
  border-top: 1px solid var(--ink);
  padding: 48px 0 64px;
  background: var(--paper-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
}
.footer-grid p { font-family: Fraunces, serif; font-size: 18px; margin: 0; color: var(--ink-soft); }
.footer-grid a { display: block; font-size: 13px; font-weight: 600; text-decoration: none; margin-bottom: 8px; }
.footer-grid small { color: var(--mute); line-height: 1.7; }

.admin-page .admin-main { padding: 56px 0 120px; max-width: 1080px; }
.admin-page h1 {
  font-family: Fraunces, serif;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.03em;
  margin: 10px 0 12px;
}
.admin-lead { color: var(--mute); max-width: 640px; line-height: 1.7; }
.admin-gate, .panel-card {
  background: var(--card);
  border: 1px solid var(--ink);
  padding: 24px;
  margin: 24px 0;
}
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--ink); margin: 28px 0 0; }
.tabs a {
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  border-bottom: 0;
}
.tabs a.active { background: var(--card); border-color: var(--ink); margin-bottom: -1px; }
.field { display: grid; gap: 6px; margin: 14px 0; }
.field label { font: 500 11px IBM Plex Mono, monospace; letter-spacing: 0.12em; text-transform: uppercase; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 11px 12px;
  color: var(--ink);
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); }
.field textarea { min-height: 160px; resize: vertical; }
.field-hint { color: var(--mute); font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.error { color: var(--oxblood); }
.ok { color: #2c4a3e; }
.job-list { display: grid; gap: 8px; margin-top: 18px; }
.post-list { display: grid; gap: 0; margin-top: 18px; }
.post-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.post-row-meta { font-size: 13px; color: var(--mute); margin-top: 4px; }
.post-row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.post-row-actions button, .post-row-actions a {
  border: 1px solid var(--ink);
  background: transparent;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.post-editor { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.job-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: 14px;
}
.kind-pills { display: flex; gap: 8px; margin-bottom: 12px; }
.kind-pills button {
  border: 1px solid var(--ink);
  background: transparent;
  padding: 8px 12px;
  cursor: pointer;
}
.kind-pills button.on { background: var(--ink); color: var(--paper); }
.artifacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.artifacts a { border: 1px solid var(--ink); padding: 6px 10px; text-decoration: none; font-size: 12px; font-weight: 600; }
.status-done { color: #2c4a3e; }
.status-error { color: var(--oxblood); }
.status-running, .status-queued { color: #8a5a12; }
.hidden { display: none !important; }
.honeypot { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.docs-layout { display: grid; grid-template-columns: 200px minmax(0, 760px); gap: 64px; padding: 64px 0 120px; }
.docs-nav { position: sticky; top: 24px; display: grid; gap: 10px; align-self: start; }
.docs-nav a { text-decoration: none; color: var(--mute); font-size: 13px; }
.docs-content h1 { font-family: Fraunces, serif; font-size: clamp(36px, 5vw, 52px); letter-spacing: -0.03em; }
.docs-content h2 { font-family: Fraunces, serif; font-size: 28px; margin: 42px 0 12px; }
.docs-content p { color: var(--mute); line-height: 1.7; }
.docs-content pre {
  background: var(--ink);
  color: var(--paper);
  padding: 20px;
  font: 400 12px/1.8 IBM Plex Mono, monospace;
  overflow: auto;
}
.endpoint { display: grid; grid-template-columns: 70px 1fr 1.2fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.endpoint b { font: 600 11px IBM Plex Mono, monospace; }

@media (max-width: 900px) {
  .nav { display: none; }
  .landing-hero, .api-grid, .hosts, .three, .docs-layout, .footer-grid { grid-template-columns: 1fr; }
  .sheet-stack { height: 360px; max-width: 380px; }
  .rule-grid { grid-template-columns: 1fr; }
  .rule-grid > * { border-left: 0; border-top: 1px solid #ffffff2b; padding: 16px 0; }
  .invite { flex-direction: column; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
