.home {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- Page header ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  margin: 0 0 6px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.page-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  font-size: 14.5px;
  color: var(--text-muted);
}
.page-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-subtle);
}

/* ---------- Search ---------- */
.toolbar { margin: 0; }

.search-box {
  position: relative;
  max-width: 420px;
}
.search-box i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-subtle);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
[data-theme="dark"] .search-box input { background: rgba(255, 255, 255, 0.04); }
.search-box input::placeholder { color: var(--text-subtle); }
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

/* ---------- Grid ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.project-card,
.new-card {
  min-height: 196px;
  border-radius: var(--radius);
  text-decoration: none;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s ease;
}
[data-theme="dark"] .project-card { background: rgba(255, 255, 255, 0.035); }
.project-card[hidden], .new-card[hidden] { display: none; }

.project-card:hover {
  color: var(--text);
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 16px 36px -14px rgba(124, 58, 237, 0.35);
}

.project-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.project-monogram {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}
.m0 { background: linear-gradient(135deg, #6366f1, #a855f7); }
.m1 { background: linear-gradient(135deg, #ec4899, #f97316); }
.m2 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.m3 { background: linear-gradient(135deg, #10b981, #06b6d4); }
.m4 { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.project-heading { flex: 1; min-width: 0; }

.project-card .card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-date { font-size: 12.5px; color: var(--text-subtle); }

.card-arrow {
  font-size: 13px;
  color: var(--text-subtle);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s var(--ease), color 0.25s ease;
}
.project-card:hover .card-arrow { opacity: 1; transform: translateX(0); color: var(--accent); }

.project-card .card-description {
  flex: 1;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.card-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-author .avatar { width: 22px; height: 22px; font-size: 10px; }

.issue-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-subtle);
  white-space: nowrap;
}
.issue-count i { font-size: 10px; }
.issue-count.has-issues { color: #e11d48; }
[data-theme="dark"] .issue-count.has-issues { color: #fb7185; }

/* "New project" placeholder card */
.new-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1.5px dashed var(--border-strong);
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.new-card:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
[data-theme="dark"] .new-card:hover { color: #d8b4fe; }

.new-card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  border-radius: 12px;
  font-size: 15px;
  background: var(--accent-soft);
  color: var(--accent);
}
[data-theme="dark"] .new-card-icon { color: #d8b4fe; }
.new-card-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text); }
.new-card-sub { font-size: 13px; }

.no-match { margin: 0; font-size: 14px; color: var(--text-muted); }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .page-head { flex-direction: column; align-items: stretch; padding-bottom: 20px; }
  .page-title { font-size: 28px; }
  .search-box { max-width: none; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card, .new-card { min-height: 0; }
  .card-arrow { opacity: 1; transform: none; }
}

/* ---------- Visitor notice: project creation is admin-only ---------- */
.admin-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 6px 0 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  transition: border-color 0.2s ease;
}
.admin-note > i { font-size: 12px; color: var(--text-subtle); }
.admin-note-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  transition: background 0.2s ease, color 0.2s ease;
}
[data-theme="dark"] .admin-note-link { color: #d8b4fe; }
.admin-note:hover { color: var(--text-muted); border-color: var(--accent); }
.admin-note:hover .admin-note-link { color: #fff; background: var(--gradient); }

.new-card.locked .new-card-icon { color: var(--text-subtle); background: var(--surface-hover); }
.new-card.locked:hover .new-card-icon { color: var(--accent); background: var(--accent-soft); }
.new-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
[data-theme="dark"] .new-card-link { color: #d8b4fe; }
.new-card-link i { font-size: 11px; transition: transform 0.25s var(--ease); }
.new-card:hover .new-card-link i { transform: translateX(4px); }

.admin-note-link { white-space: nowrap; flex: none; }

@media (max-width: 640px) {
  .admin-note { height: auto; min-height: 44px; padding: 6px 6px 6px 14px; line-height: 1.35; }
  .admin-note > span:first-of-type { flex: 1; }
}

