/* ============================================================
   Per-project skins: card motifs + subpage decorations.
   Every element here is decorative (aria-hidden in markup).
   ============================================================ */

/* ---------- card motifs (shared) ---------- */

.motif {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

/* ---------- Undelivered: a parcel teeters on one wheel ---------- */

.motif-undelivered {
  position: relative;
}

.motif-undelivered .porch-lamp {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

.project-card:hover .motif-undelivered .porch-lamp {
  opacity: 1;
  animation: porch-flicker 2.4s ease-in-out infinite;
}

/* Pivot at the axle: the whole rig teeters like the game does. */
.motif-undelivered .parcel-rig {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 20px;
  margin-left: -10px;
  transform-origin: 50% 100%;
  animation: parcel-teeter 2.6s ease-in-out infinite alternate;
}

.project-card:hover .motif-undelivered .parcel-rig {
  animation-duration: 0.7s;
}

.motif-undelivered .parcel-box {
  display: block;
  width: 20px;
  height: 24px;
  border-radius: 2px;
  background: #b98a52;
  box-shadow: inset 0 -6px 0 #8f6836;
  position: relative;
}

/* THIS WAY UP */
.motif-undelivered .parcel-box::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 4px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-left: 2px solid #e8e4d8;
  border-top: 2px solid #e8e4d8;
  transform: rotate(45deg);
}

.motif-undelivered .parcel-wheel {
  display: block;
  width: 12px;
  height: 12px;
  margin: -2px auto 0;
  border-radius: 50%;
  background: radial-gradient(circle, #12131a 0 2px, var(--accent) 2px 5px, #292933 5px);
  position: relative;
  animation: wheel-roll 1.8s linear infinite;
}

/* the valve dot that makes the roll visible */
.motif-undelivered .parcel-wheel::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  width: 2px;
  height: 2px;
  margin-left: -1px;
  border-radius: 50%;
  background: #12131a;
}

.project-card:hover .motif-undelivered .parcel-wheel {
  animation-duration: 0.5s;
}

@keyframes parcel-teeter {
  from {
    transform: rotate(-7deg);
  }

  to {
    transform: rotate(7deg);
  }
}

@keyframes wheel-roll {
  to {
    transform: rotate(360deg);
  }
}

@keyframes porch-flicker {
  0%,
  100% {
    opacity: 1;
  }

  46% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }

  54% {
    opacity: 1;
  }
}

/* ---------- Typero: keycaps press in sequence ---------- */

.motif-typero {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: auto;
}

.motif-typero .keycap {
  font-size: 0.6rem;
  padding: 3px 6px 5px;
  color: var(--text-faint);
  transition:
    transform 0.15s ease,
    border-bottom-width 0.15s ease,
    color 0.15s ease;
}

.project-card:hover .motif-typero .keycap {
  color: var(--accent);
  animation: keypress 0.9s ease-in-out infinite;
}

.project-card:hover .motif-typero .key-2 {
  animation-delay: 0.15s;
}

.project-card:hover .motif-typero .key-3 {
  animation-delay: 0.3s;
}

@keyframes keypress {
  0%,
  40%,
  100% {
    transform: translateY(0);
    border-bottom-width: 3px;
  }
  20% {
    transform: translateY(2px);
    border-bottom-width: 1px;
  }
}

/* ============================================================
   Subpage skins
   ============================================================ */

.project-card--orbital-dodge .card-icon,
.project-page--orbital-dodge .project-icon {
  image-rendering: auto;
}

/* ---------- Orbital Dodge: celestial instrument ---------- */

.project-page--orbital-dodge .project-name {
  animation:
    enter 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards,
    signal-breathe 1.71s ease-in-out 1s infinite;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 35%, transparent));
}

@keyframes signal-breathe {
  0%,
  100% {
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 25%, transparent));
  }
  50% {
    filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 55%, transparent));
  }
}

.project-page--orbital-dodge .play-stage {
  aspect-ratio: 1024 / 500;
  min-height: 0;
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: inset 0 0 60px -30px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ---------- Typero: mono + caret ---------- */

.project-page--typero .project-name,
.project-page--typero .note-title {
  font-family: var(--font-mono);
}

.project-page--typero .project-name {
  letter-spacing: -0.04em;
}

.project-page--typero .project-name::after {
  content: '▍';
  margin-left: 6px;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: var(--accent);
  color: var(--accent);
  animation: caret-blink 1.1s steps(1) infinite;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}
