* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --card: #0f3460;
  --accent: #e94560;
  --text: #eee;
  --text-muted: #a0a0b8;
  --green: #4ecca3;
  --yellow: #f0c040;
  --red: #e94560;
  --blue: #4ea8de;
  --purple: #b388ff;
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 2rem 2rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.last-updated {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Grid */
.project-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  padding: 1rem 2rem 2rem;
  align-content: start;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 4rem 0;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.card-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-in_progress { background: var(--blue); color: #fff; }
.badge-paused      { background: var(--yellow); color: #1a1a2e; }
.badge-blocked     { background: var(--red); color: #fff; }
.badge-shipped     { background: var(--green); color: #1a1a2e; }
.badge-planning    { background: var(--purple); color: #1a1a2e; }

.card-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.priority-high   { color: var(--red); }
.priority-medium { color: var(--yellow); }
.priority-low    { color: var(--green); }

/* Blockers */
.blockers-toggle {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 0.75rem;
  padding: 0.2em 0.55em;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.blockers-toggle:hover {
  background: var(--red);
  color: #fff;
}

.blockers-list {
  display: none;
  list-style: none;
  font-size: 0.82rem;
  padding-left: 0;
}

.blockers-list.open {
  display: block;
}

.blockers-list li {
  padding: 0.3em 0;
  color: var(--red);
  border-bottom: 1px solid rgba(233,69,96,0.15);
}

.blockers-list li::before {
  content: "• ";
}

.target-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Footer */
footer {
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.06);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Header nav */
.header-nav {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.nav-link-pill {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--accent);
  padding: 0.25em 0.75em;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.nav-link-pill:hover {
  background: var(--accent);
  color: #fff;
}

/* Pipeline Summary */
.pipeline-summary {
  padding: 0 2rem;
}

.pipeline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: border-color 0.15s, transform 0.12s;
}

.pipeline-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.pipeline-link strong {
  color: var(--text);
  font-weight: 700;
}

.pipeline-divider {
  color: rgba(255, 255, 255, 0.15);
}

.pipeline-stat {
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 480px) {
  header { padding: 1.25rem 1rem 0.75rem; }
  .project-grid { padding: 0.75rem 1rem 1.5rem; grid-template-columns: 1fr; }
  footer { padding: 1rem; }
}
