/* ===== Projects page ===== */

/* ===== Projects ===== */
.project-card { display: flex; flex-direction: column; position: relative; }

/* Whole card is clickable: the title link stretches over it. Other links sit above. */
.project-card-link { color: inherit; }
.project-card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.project-card-link:focus-visible { outline: none; }
.project-card-link:focus-visible::after { outline: 2px solid var(--terracotta); outline-offset: 2px; border-radius: 4px; }
.project-card:hover .project-link { color: var(--terracotta-dim); }

.project-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.project-card-by {
  font-size: 0.75rem;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured-badge {
  align-self: flex-start;
  background: var(--terracotta-muted);
  color: var(--terracotta);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  border: 1px solid var(--terracotta-border);
  margin-bottom: 0.75rem;
}
.project-card.is-featured { border-color: var(--terracotta-border); }

.built-at {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.built-at::before { content: '@ '; color: var(--terracotta); }
.pd-badges .built-at { margin-bottom: 0.75rem; align-self: center; }

.project-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 3px;
  margin-bottom: 0.75rem;
}

.project-card p { flex: 1; color: var(--text-secondary); font-size: 0.8125rem; }
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 1.25rem 0 0.875rem;
}
.tech-tag {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.2rem 0.625rem;
  border-radius: 2px;
  border: 1px solid var(--border-strong);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.project-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--terracotta);
  transition: color 0.2s;
  letter-spacing: 0.04em;
}
.project-link:hover { color: var(--terracotta-dim); }

.project-card.coming-soon {
  opacity: 0.5;
}

.coming-soon-badge {
  display: inline-block;
  background: transparent;
  color: var(--text-faint);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  border: 1px solid var(--border-strong);
  margin-bottom: 0.75rem;
  align-self: flex-start;
}

.project-link-disabled {
  cursor: default;
  opacity: 0.35;
}

.project-link-disabled:hover {
  color: var(--terracotta);
}

/* ===== Project detail ===== */
.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--terracotta); }

.pd-badges { display: flex; gap: 0.5rem; }
.pd-badges:empty { display: none; }
.pd-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}
.pd-lede { font-size: 1rem; line-height: 1.75; max-width: 44rem; margin: 0 0 1.25rem; }
.pd-tags { margin: 0 0 1.5rem; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.pd-header { margin-bottom: 2rem; }

.pd-cover {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--terracotta);
  margin-bottom: 2.5rem;
}

.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 3rem;
  align-items: start;
}
.pd-block { margin-bottom: 2.5rem; }
.pd-h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 1rem;
}
.pd-h2::before { content: '~/ '; color: var(--terracotta); font-family: var(--font-mono); font-weight: 400; }
.pd-prose p { font-size: 0.95rem; line-height: 1.85; color: var(--text-secondary); margin: 0 0 1rem; }

.pd-video { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--border-default); border-radius: 4px; overflow: hidden; }
.pd-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.pd-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
.pd-shot {
  display: block;
  padding: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  text-align: left;
  transition: border-color 0.2s;
}
.pd-shot:hover, .pd-shot:focus-visible { border-color: var(--terracotta); outline: none; }
.pd-shot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pd-shot-caption { display: block; padding: 0.5rem 0.75rem; font-size: 0.75rem; color: var(--text-secondary); }

.pd-side { position: sticky; top: 6rem; display: flex; flex-direction: column; gap: 1rem; }
.pd-side-block {
  background: var(--surface-raised);
  border: 1px solid var(--terracotta);
  border-radius: 4px;
  padding: 1.25rem;
}
.pd-side-h {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 0 0 0.875rem;
}
.pd-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; margin: 0; font-size: 0.8rem; }
.pd-facts dt { color: var(--text-faint); }
.pd-facts dd { margin: 0; color: var(--text-primary); text-align: right; }
.pd-cta p { font-size: 0.8rem; line-height: 1.7; margin: 0 0 1rem; }

.builder-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0;
  color: var(--text-primary);
}
.builder-chip + .builder-chip { border-top: 1px solid var(--border-subtle); padding-top: 0.75rem; margin-top: 0.375rem; }
.builder-chip:hover .builder-chip-name { color: var(--terracotta); }
.builder-avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.builder-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-overlay);
  color: var(--terracotta);
  font-weight: 700;
  font-size: 0.8rem;
}
.builder-chip-text { display: flex; flex-direction: column; min-width: 0; }
.builder-chip-name { font-size: 0.875rem; font-weight: 600; transition: color 0.2s; }
.builder-chip-sub { font-size: 0.72rem; color: var(--text-faint); }

/* ===== Builder profile ===== */
.bd-header { display: flex; gap: 2rem; align-items: flex-start; margin-bottom: 3rem; }
.bd-photo {
  width: 140px;
  height: 140px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.bd-photo-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-overlay);
  color: var(--terracotta);
  font-size: 2.25rem;
  font-weight: 700;
}
.bd-sub { margin: 0 0 0.75rem; font-size: 0.875rem; }

@media (max-width: 860px) {
  .pd-layout { grid-template-columns: 1fr; gap: 2rem; }
  .pd-side { position: static; }
  .bd-header { flex-direction: column; gap: 1.25rem; }
}

/* Single-screenshot projects hide the prev/next arrows (gallery.css sets display:flex on them) */
.lightbox-btn[hidden] { display: none; }

/* ===== Write-it-up intro (write_am.gif is wider than the other feature art) ===== */
/* Same footprint as the about-page art: art centred in its column with even padding top and
   bottom, and a frame tall enough that the art never crowds the border. */
.projects-intro { min-height: 320px; }
.projects-intro .feature-intro-art { padding: 1rem 2.5rem 1rem 0; }
.projects-intro .feature-intro-img { max-width: 300px; max-height: 240px; width: auto; }
.projects-intro .feature-intro-copy { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 768px) {
  .projects-intro { min-height: 0; }
  .projects-intro .feature-intro-art { padding: 0; }
  .projects-intro .feature-intro-img { max-width: 220px; }
}

.projects-cta { display: flex; justify-content: center; margin-top: 1.5rem; }
