:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --text: #1f2430;
  --muted: #6b7080;
  --line: #e4ddcf;
  --accent: #d9622b;
  --accent-text: #fff;
  --ok: #2f8a4f;
  --err: #c23b3b;
  --b-grywalny: #2f8a4f;
  --b-prototyp: #b7791f;
  --b-koncept: #7a5bc2;
  --b-ukonczony: #2563c9;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 6px 20px rgb(0 0 0 / .06);
  --font-head: 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171d;
    --surface: #1e2129;
    --text: #e9e6df;
    --muted: #9a9eab;
    --line: #2e323d;
    --accent: #f07a43;
    --accent-text: #15171d;
    --ok: #5ec27f;
    --err: #ef6b6b;
    --b-grywalny: #5ec27f;
    --b-prototyp: #e2a649;
    --b-koncept: #a98af0;
    --b-ukonczony: #6a9bf0;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-body);
}
a { color: var(--accent); }
h1, h2 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 800; margin-top: 1.6em; }

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

.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font: 800 1.25rem var(--font-head); color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.head-link { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.head-link:hover { color: var(--accent); }

.site-foot { border-top: 1px solid var(--line); margin-top: 64px; padding: 24px 0 40px; color: var(--muted); font-size: .9rem; }

.hero { padding: 48px 0 28px; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 600px; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; color: var(--text); text-decoration: none; box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card h2 { margin: 6px 0 0; font-size: 1.5rem; }
.card p { margin: 0 0 12px; color: var(--muted); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 99px;
  font-size: .8rem; font-weight: 700;
  color: var(--b, var(--muted));
  border: 1.5px solid currentColor;
}
.badge-grywalny { --b: var(--b-grywalny); }
.badge-prototyp { --b: var(--b-prototyp); }
.badge-koncept { --b: var(--b-koncept); }
.badge-ukonczony { --b: var(--b-ukonczony); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .8rem; padding: 1px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.muted { color: var(--muted); }

.back { display: inline-block; margin: 28px 0 20px; color: var(--muted); text-decoration: none; font-weight: 600; }
.back:hover { color: var(--accent); }
.project .lead { font-size: 1.2rem; color: var(--muted); margin-top: 0; }
.actions { margin: 20px 0; display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: var(--accent-text);
  border: 0; border-radius: 10px; padding: 10px 18px;
  font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); filter: none; }
.btn-danger { background: var(--err); color: #fff; padding: 4px 12px; font-size: .85rem; margin-left: auto; }

.downloads { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.note { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }

.comments { margin-top: 48px; padding-top: 8px; border-top: 1px solid var(--line); }
#comment-form, #admin-login { display: grid; gap: 10px; margin-bottom: 24px; }
input, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: 1rem;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 100px; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-row .note { margin: 0; flex: 1 1 240px; }
#admin-login.form-row input { flex: 1 1 220px; width: auto; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.msg { margin: 0; min-height: 1.4em; font-weight: 600; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); }

.comment-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.comment-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.comment-list li.empty { background: none; border-style: dashed; text-align: center; }
.comment-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: .95rem; }
.comment-list p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
