/* OpenSauce web UI. Plain CSS with light and dark themes via color tokens. */

:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --ink: #1c1f24;
  --muted: #5f6672;
  --line: #e2e3dd;
  --accent: #113bf6;
  --accent-ink: #ffffff;
  --accent-soft: #e7ecff;
  --money: #0b6e4f;
  --warn-bg: #fff4d6;
  --warn-line: #d9a520;
  --error-bg: #fdecea;
  --error-line: #c8414b;
  --ok-bg: #e6f4ec;
  --ok-line: #2f9a65;
  --badge-open: #0b6e4f;
  --badge-funding: #946200;
  --badge-review: #3558b8;
  --badge-paid: #6b4bb8;
  --badge-closed: #6b7280;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 2px 8px rgb(0 0 0 / 0.04);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --ink: #e7e9ee;
    --muted: #9aa1ad;
    --line: #2b2f37;
    --accent: #7b93ff;
    --accent-ink: #0a0f2e;
    --accent-soft: #19214a;
    --money: #4fd39e;
    --warn-bg: #2c2414;
    --warn-line: #b8892a;
    --error-bg: #2e171a;
    --error-line: #e3707a;
    --ok-bg: #132a20;
    --ok-line: #3cbf8b;
    --badge-open: #4fd39e;
    --badge-funding: #e1b45a;
    --badge-review: #8aa6f0;
    --badge-paid: #b49bf0;
    --badge-closed: #9aa1ad;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

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

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand img { height: 32px; width: auto; display: block; }
.wordmark span { color: var(--accent); }
nav { display: flex; gap: 16px; flex: 1; }
nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--ink); }
.account { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.account form { margin: 0; }
.who { color: var(--muted); }

.test-banner { background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); font-size: 14px; }
.test-banner .wrap { padding-block: 8px; }

main { padding-block: 28px 48px; }
.site-footer { color: var(--muted); font-size: 13px; padding-block: 24px 40px; border-top: 1px solid var(--line); }

/* Type */
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.lede { font-size: 17px; color: var(--muted); max-width: 60ch; margin: 0 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--muted); }

/* Buttons and forms */
.button {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.button:hover { filter: brightness(1.05); }
.button.secondary { background: transparent; color: var(--accent); }
.button.small { padding: 6px 12px; font-size: 14px; }
.link-button { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { max-width: 160px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.validation-message { color: var(--error-line); font-size: 13px; margin-top: 4px; }

.notice { padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 12px 0 0; }
.notice.error { background: var(--error-bg); border-left: 3px solid var(--error-line); }
.notice.ok { background: var(--ok-bg); border-left: 3px solid var(--ok-line); margin: 0 0 12px; }

/* Layout pieces */
.hero { padding: 12px 0 28px; }
.hero h1 { font-size: 36px; max-width: 18ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.page-head, .detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1, .detail-head h1 { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow); }
section > h2 { margin-top: 8px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.detail-grid .card { margin: 0; }
.amount-card .button { margin-top: 6px; }
.big-amount { font-size: 40px; font-weight: 800; color: var(--money); letter-spacing: -0.02em; line-height: 1.1; }

.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.progress span { display: block; height: 100%; background: var(--accent); }

/* Lists */
.bounty-list, .repo-list, .steps { list-style: none; margin: 0; padding: 0; }
.bounty-list li + li { margin-top: 8px; }
.bounty-row {
  display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
.bounty-row:hover { border-color: var(--accent); }
.bounty-row .amount { font-weight: 800; font-size: 20px; color: var(--money); }
.bounty-row .body { min-width: 0; }
.bounty-row .title { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bounty-row .meta { display: block; font-size: 13px; color: var(--muted); }

.repo-list li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.steps { counter-reset: step; }
.steps li { counter-increment: step; padding-left: 30px; position: relative; margin-bottom: 8px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px; width: 21px; height: 21px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}

.empty { color: var(--muted); padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* Status badges */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.badge-open { color: var(--badge-open); }
.badge-funding { color: var(--badge-funding); }
.badge-review { color: var(--badge-review); }
.badge-paid { color: var(--badge-paid); }
.badge-closed { color: var(--badge-closed); }

@media (max-width: 640px) {
  h1, .hero h1 { font-size: 26px; }
  .detail-grid, .field-row { grid-template-columns: 1fr; }
  .bounty-row { grid-template-columns: 1fr auto; }
  .bounty-row .amount { grid-column: 1 / -1; }
  nav { order: 3; flex-basis: 100%; }
}
