/* ============================================================
   Recent projects strip — horizontal grid of recent project cards
   on the Home view, with a "View all" anchor that switches to the
   Projects view.
   ============================================================ */
.home-existing-project {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-panel) 78%, var(--bg-subtle));
}
.home-existing-project__subtitle {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  color: var(--text-muted);
}
.home-existing-project__form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}
.home-existing-project__button {
  appearance: none;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-foreground, #fff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 184px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.home-existing-project__button:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}
.home-existing-project__button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.recent-projects {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.recent-projects__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.recent-projects__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}
.recent-projects__view-all {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}
.recent-projects__view-all:hover {
  color: var(--text);
  background: var(--bg-subtle);
}
.recent-projects__empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.recent-projects__row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.recent-projects__card {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.recent-projects__card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.recent-projects__card.is-design-system-project {
  border-color: color-mix(in srgb, var(--red) 62%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 42%, transparent);
}
.recent-projects__card.is-design-system-project:hover {
  border-color: var(--red);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--red) 54%, transparent),
    var(--shadow-sm);
}
.recent-projects__card-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--accent-tint) 0%, var(--bg-subtle) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  /* Container for the HTML preview iframe's responsive scale (below): the
   * iframe renders at a fixed desktop design width and is scaled by the
   * card's own width so the page reads as a faithful thumbnail instead of
   * collapsing at the narrow card width. */
  container-type: inline-size;
}
.recent-projects__card-thumb-html,
.recent-projects__card-thumb-image,
.recent-projects__card-thumb-video,
.recent-projects__card-thumb-logo {
  background: var(--bg-subtle);
}
.recent-projects__thumb-media,
.recent-projects__thumb-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.recent-projects__thumb-media {
  object-fit: cover;
}
.recent-projects__card-thumb-logo .recent-projects__thumb-media {
  inset: 22%;
  width: 56%;
  height: 56%;
  object-fit: contain;
}
.recent-projects__thumb-iframe {
  pointer-events: none;
  background: #fff;
  /* Render the page at a desktop design width, then scale it down to the
   * card width via a container query so non-responsive galleries don't
   * collapse at the narrow card size. 1280x720 keeps the 16/9 thumb ratio,
   * so the scaled iframe fills the thumb exactly. */
  inset: auto;
  top: 0;
  left: 0;
  width: 1280px;
  height: 720px;
  transform-origin: 0 0;
  transform: scale(calc(100cqw / 1280px));
}
.recent-projects__deck-frame,
.recent-projects__deck-iframe,
.recent-projects__deck-cover-loading {
  position: absolute;
  inset: 0;
}
.recent-projects__deck-frame {
  overflow: hidden;
  background: #fff;
}
.recent-projects__deck-iframe {
  width: 1280px;
  height: 720px;
  border: 0;
  pointer-events: none;
  transform: scale(var(--recent-deck-scale, 1));
  transform-origin: 0 0;
}
.recent-projects__deck-cover-loading {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.52) 50%, transparent 70%) 0 0 / 200% 100%,
    var(--bg-subtle);
  animation: recent-projects-shimmer 1.4s ease-in-out infinite;
}
.recent-projects__card-glyph {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.recent-projects__card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px 12px;
  min-width: 0;
}
.recent-projects__card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-projects__card-time {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.recent-projects__card-sep {
  color: var(--text-muted);
}
.recent-projects__card-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.recent-projects__card-status-running {
  color: var(--accent);
}
.recent-projects__card-status-awaiting_input {
  color: var(--amber);
}
.recent-projects__card-status-queued,
.recent-projects__card-status-not_started,
.recent-projects__card-status-canceled {
  color: var(--text-muted);
}
.recent-projects__card-status-succeeded {
  color: var(--green);
}
.recent-projects__card-status-failed {
  color: var(--red);
}
.recent-projects__card-status-published {
  color: var(--green);
}
.recent-projects__card-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.recent-projects__card-status-running .recent-projects__card-status-dot {
  animation: recent-projects-pulse 1.4s ease-in-out infinite;
}
@keyframes recent-projects-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes recent-projects-shimmer {
  to {
    background-position: -200% 0, 0 0;
  }
}

@media (max-width: 720px) {
  .home-existing-project__form {
    justify-content: center;
  }
  .home-existing-project__button {
    white-space: normal;
  }
}
