:root {
  color-scheme: light;
  --ink: #0b0b0b;
  --paper: #f4f1e8;
  --white: #ffffff;
  --cyan: #20c5d8;
  --cyan-dark: #087d8a;
  --red: #e43d24;
  --muted: #67655f;
  --line: #0b0b0b;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 4px;
  --radius-sm: 2px;
  --content: 860px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font: inherit; }

:focus-visible {
  outline: 3px solid var(--cyan-dark);
  outline-offset: 3px;
}

/* --- header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}

.header-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand img {
  width: 36px;
  height: 36px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.forum-title {
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan-dark);
  padding-left: 12px;
  border-left: 2px solid var(--ink);
  margin-right: auto;
}

.user-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-pill {
  font-size: 0.85rem;
  color: var(--muted);
}

.user-pill strong { color: var(--ink); }

/* --- buttons: sharp corners, hard shadow, press-into-shadow on hover. no pills. --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 110ms ease, box-shadow 110ms ease;
}

.btn:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }

.btn-primary { background: var(--cyan); }
.btn-ghost { background: var(--white); }
.btn-danger { background: var(--red); color: var(--white); }

.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.site-main {
  max-width: var(--content);
  margin: 0 auto;
  padding: 32px 20px 72px;
}

.section-heading {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 3px solid var(--ink);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--cyan-dark);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 {
  margin: 32px 0 14px;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.muted { color: var(--muted); }

/* --- flash / info banners: flat chip like .legal-date on the main site, no rounded pastel alert boxes --- */
.flash {
  padding: 11px 14px;
  border: 2px solid var(--ink);
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.flash-error { background: var(--red); color: var(--white); }
.flash-success { background: var(--cyan); }
.flash-info { background: var(--white); }

/* --- cards --- */
.card {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.category-list, .topic-list { display: flex; flex-direction: column; gap: 14px; }

.category-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.category-card:hover { transform: translate(3px, 3px); box-shadow: var(--shadow-sm); }

.category-card .cat-name { font-weight: 900; font-size: 1.05rem; letter-spacing: -0.01em; }
.category-card .cat-desc { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.category-card .cat-stats { text-align: right; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.category-card .cat-stats strong { display: block; color: var(--ink); font-size: 1.15rem; font-weight: 900; }

.topic-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.topic-row:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.topic-row .topic-main { min-width: 0; }
.topic-row .topic-title { font-weight: 800; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topic-row .topic-meta { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.topic-row .topic-stats { text-align: right; font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.topic-row .topic-stats strong { display: block; color: var(--ink); font-size: 1rem; font-weight: 900; }

/* --- tags: flat bordered chip, no pill radius (models .code on the main site) --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.5;
}

.badge-pinned { background: var(--cyan); }
.badge-locked { background: var(--paper); color: var(--muted); }

/* --- single post / reply --- */
.post {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 16px;
}

.post-author { display: flex; flex-direction: column; gap: 6px; }

.post-author .avatar {
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.05rem;
}

.post-author .username { font-weight: 900; font-size: 0.92rem; }
.post-author .role { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--cyan-dark); }

.post-body { min-width: 0; }
.post-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.post-content { white-space: pre-wrap; word-wrap: break-word; }
.post-content a { color: var(--cyan-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* --- forms --- */
form.stack { display: flex; flex-direction: column; gap: 14px; }

label { font-weight: 800; font-size: 0.85rem; display: block; margin-bottom: 6px; }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  padding: 9px 11px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--white);
  color: var(--ink);
}

textarea { min-height: 160px; resize: vertical; }

.form-row { display: flex; flex-direction: column; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* --- pagination --- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }

.page-link {
  padding: 6px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-weight: 800;
  font-size: 0.82rem;
}

.page-link.is-active { background: var(--cyan); }

.breadcrumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 16px; font-weight: 600; }
.breadcrumbs a { color: var(--cyan-dark); font-weight: 800; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
}

/* --- footer --- */
.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}

.footer-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-inner p { margin: 0; color: #bdbdbd; font-size: 0.78rem; }
.footer-inner nav { display: flex; gap: 16px; }
.footer-inner a { font-size: 0.78rem; font-weight: 800; text-underline-offset: 3px; }
.footer-inner a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .post { grid-template-columns: 1fr; }
  .post-author { flex-direction: row; align-items: center; }
  .category-card, .topic-row { flex-direction: column; align-items: flex-start; }
  .category-card .cat-stats, .topic-row .topic-stats { text-align: left; }
}
