/* Projects page — card grid + modal */

.pg-filters { margin: 0 0 1.2rem; }
.pg-filter-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; }
.pg-filter-label { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: #777; min-width: 130px; text-transform: uppercase; letter-spacing: 0.06em; }
.pg-filter-row button { font: 500 0.78rem 'IBM Plex Mono', monospace; padding: 0.28rem 0.6rem; border: 1px solid #d4d9d6; background: #fff; border-radius: 999px; cursor: pointer; color: #333; }
.pg-filter-row button.is-on { background: #1a6b4a; color: #fff; border-color: #1a6b4a; }

.pg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
  margin: 1.5rem 0;
}

.pg-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: #fff;
  border: 1px solid #e3e8e5;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  font: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}
.pg-card:hover, .pg-card:focus-visible {
  box-shadow: 0 4px 16px rgba(26, 107, 74, 0.14);
  transform: translateY(-2px);
  outline: none;
}

.pg-card-media { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #1e2220; overflow: hidden; }
.pg-card-video { width: 100%; height: 100%; object-fit: cover; display: block; }

.pg-pill {
  position: absolute; top: 8px; left: 8px;
  font: 500 0.62rem 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff;
}
.pg-state {
  position: absolute; right: 8px; bottom: 8px;
  font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.62); color: #fff;
}
.pg-state--production { background: #1a6b4a; }
.pg-state--shipped { background: #2b5ea8; }
.pg-state--prototype { background: #8a6d1f; }
.pg-state--archived { background: #666; }

.pg-growth-stage {
  position: absolute; top: 8px; right: 8px;
  font-size: 0.85rem; line-height: 1;
  padding: 3px 5px; border-radius: 999px; background: rgba(0, 0, 0, 0.5);
  cursor: help;
}

.pg-modal-title-row .pg-growth-stage {
  position: static; background: none; padding: 0; font-size: 1rem;
}

.pg-card-info { padding: 0.7rem 0.85rem 0.85rem; }
.pg-card-title { font-weight: 700; font-size: 0.95rem; color: #1a1a1a; }
.pg-card-descriptor { font-size: 0.78rem; color: #6b6b7a; margin-top: 0.15rem; }
.pg-card-meta { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; color: #888; margin-top: 0.35rem; }

/* ── Modal ─────────────────────────────────────────────────────────────── */

body.pg-modal-open { overflow: hidden; }

.pg-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 18, 16, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  animation: pgFadeIn 0.15s ease-out;
}
@keyframes pgFadeIn { from { opacity: 0; } to { opacity: 1; } }

.pg-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 920px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}
@media (max-width: 760px) {
  .pg-modal { grid-template-columns: 1fr; }
}

.pg-modal-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  background: rgba(0, 0, 0, 0.55); color: #fff; border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 1.3rem; line-height: 1; cursor: pointer;
}

.pg-modal-media { background: #1e2220; display: flex; align-items: center; justify-content: center; min-height: 220px; }
.pg-modal-video { width: 100%; height: 100%; max-height: 88vh; object-fit: contain; display: block; }
.pg-modal-undisclosed { color: #ccc; font-size: 0.85rem; padding: 2rem; text-align: center; }

.pg-modal-body { padding: 1.4rem 1.5rem; }
.pg-modal-title-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.pg-modal-title { margin: 0; font-size: 1.3rem; }
.pg-modal-title-row .pg-state { position: static; }
.pg-modal-descriptor { font-size: 0.85rem; color: #6b6b7a; margin-top: 0.15rem; }
.pg-modal-meta { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: #777; margin-top: 0.4rem; }
.pg-purpose span { display: inline-block; font: 500 0.6rem 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid #cfd8d3; border-radius: 999px; padding: 1px 6px; margin-left: 4px; color: #1a6b4a; }
.pg-modal-desc { font-size: 0.92rem; line-height: 1.55; margin: 0.8rem 0; color: #2a2a2f; }
.pg-modal-tech { margin: 0.6rem 0; }
.pg-modal-org { font-size: 0.85rem; color: #444; margin-top: 0.6rem; }
.pg-modal-deploy { color: #1a6b4a; font-size: 0.82rem; margin-top: 0.25rem; }
.pg-modal-deploy .origin { font-weight: 700; }
.pg-modal-credits { font-size: 0.82rem; color: #555; margin-top: 0.25rem; }

.pg-link-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.1rem; }
.pg-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font: 500 0.82rem 'IBM Plex Mono', monospace;
  padding: 0.4rem 0.8rem; border-radius: 6px; text-decoration: none;
  border: 1px solid #d4d9d6; color: #1a1a1a;
}
.pg-link--repo { border-color: #2b5ea8; color: #2b5ea8; }
.pg-link--deepdive { border-color: #1a6b4a; color: #1a6b4a; }
.pg-link--paper { border-color: #8a6d1f; color: #8a6d1f; }
.pg-link:hover { filter: brightness(0.95); }
