:root {
  --paper: #FAFAF7;
  --card: #FFFFFF;
  --ink: #14161A;
  --ink-soft: #63666D;
  --line: #14161A;
  --flame: #FF4D1C;
  --flame-soft: #FFE3D6;
  --teal: #0F7A6C;
  --teal-soft: #D8EFEA;
  --indigo: #1C2541;
  --urgent: #C81E3A;
  --urgent-soft: #FBDDE2;
  --radius: 10px;
  --display: "Space Grotesk", -apple-system, Segoe UI, sans-serif;
  --body: "Inter", -apple-system, Segoe UI, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Top bar ---------- */

.top {
  padding: 1.4rem 1.2rem 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.top__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.top__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  margin: 0;
  letter-spacing: -0.01em;
}

.top__title span {
  color: var(--flame);
}

.top__live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--teal);
  border: 1.5px solid var(--teal);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.top__live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.top__sub {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 52ch;
}

/* ---------- Toolbar ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 2px solid var(--line);
  padding: 0.85rem 1.2rem;
}

.toolbar__inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.toolbar__search {
  flex: 1 1 200px;
  min-width: 160px;
  padding: 0.6rem 0.85rem;
  border: 2px solid var(--line);
  background: var(--card);
  font-family: var(--body);
  font-size: 0.92rem;
  color: var(--ink);
  border-radius: var(--radius);
}

.toolbar__search:focus-visible { outline: 3px solid var(--flame); outline-offset: 1px; }

.sort {
  display: flex;
  gap: 0.4rem;
}

.sort__btn {
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 0.5rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.sort__btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.chips {
  max-width: 1000px;
  margin: 0.65rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 0.32rem 0.7rem;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.78rem;
  border-radius: 999px;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--flame);
  border-color: var(--flame);
  color: #fff;
}

.count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  max-width: 1000px;
  margin: 0.6rem auto 0;
}

/* ---------- Feed ---------- */

.feed {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 1.2rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.9rem;
}

.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
}

.card__tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tag--new { background: var(--teal-soft); color: var(--teal); }
.tag--urgent { background: var(--urgent-soft); color: var(--urgent); }
.tag--closed { background: #EDEDEB; color: var(--ink-soft); }
.tag--mode { background: var(--flame-soft); color: var(--flame); }

.card__board {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--indigo);
  font-weight: 600;
}

.card__title {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
}

.card__post {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
}

.card__stats {
  display: flex;
  gap: 1.1rem;
  align-items: baseline;
  margin-top: 0.15rem;
}

.stat__num {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--flame);
  line-height: 1;
}

.stat__label {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  display: block;
  margin-top: 0.15rem;
}

.card__qual {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.card__deadline {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink);
  border-top: 1.5px dashed var(--line);
  padding-top: 0.55rem;
  margin-top: 0.1rem;
}

.card__cta {
  display: block;
  text-align: center;
  margin-top: 0.3rem;
  background: var(--ink);
  color: var(--paper) !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem;
  border-radius: var(--radius);
}

.card__cta:hover { background: var(--flame); }

/* ---------- Empty ---------- */

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-soft);
}

.empty__title {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

/* ---------- Footer ---------- */

.footer {
  text-align: center;
  padding: 2rem 1.2rem 3rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  border-top: 2px solid var(--line);
}

.footer a { text-decoration: underline; }

@media (max-width: 480px) {
  .toolbar__inner { flex-wrap: wrap; }
  .sort { width: 100%; }
  .sort__btn { flex: 1; text-align: center; }
}