/* Project thumbnails: the small live interfaces on the home page work cards.
   Shared by index.html. --k (set by script) scales the 280px interface to its frame. */

.card-media {
    position: relative;
    aspect-ratio: 20 / 13;
    border-radius: 20px;
    overflow: hidden;
}
.card-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: scale(1);
    transition: transform 0.3s ease;
    will-change: transform;
}
/* Each project's card color */
.m-search { --tone: #FBE5EE; }
.m-health { --tone: #DDF2E8; }
.m-security { --tone: #E0EBFB; }
.m-places { --tone: #ECE6FA; }
.card-media { background: var(--tone); }
.vg-ui { position: absolute; left: 50%; top: 50%; width: 280px; display: flex; flex-direction: column; gap: 10px;
         transform: translate(-50%, -50%) scale(var(--k, 1.6)); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* every mini-interface loops only while it is on screen; the resting state below is the finished one */
.card-media:not(.is-live) .vg-ui * { animation-play-state: paused; }
.vg-ui { --loop: 8s; }

/* search: type, then suggestions arrive */
.s-bar { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 9px 12px; font-size: 12px; color: var(--ink); }
.s-icon { flex: none; width: 10px; height: 10px; border: 1.6px solid var(--ink); border-radius: 50%; position: relative; }
.s-icon::after { content: ''; position: absolute; width: 5px; height: 1.6px; background: var(--ink); right: -5px; bottom: -2px; transform: rotate(45deg); }
.s-type { display: inline-block; overflow: hidden; white-space: nowrap; width: 100%; animation: sType var(--loop) steps(18, end) infinite; }
.s-caret { flex: none; width: 1.5px; height: 13px; background: var(--ink); margin-left: -6px; animation: blink 0.9s steps(1) infinite; }
.s-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.s-list li { background: rgba(255, 255, 255, 0.7); border-radius: 8px; padding: 6px 10px; font-size: 11.5px; color: var(--muted); animation: sLi var(--loop) ease infinite; }
.s-list li:nth-child(2) { animation-delay: 0.3s; }
.s-list li:nth-child(3) { animation-delay: 0.6s; }
@keyframes sType { 0%, 6% { width: 0; } 38%, 90% { width: 100%; } 97%, 100% { width: 0; } }
@keyframes sLi { 0%, 40% { opacity: 0; transform: translateY(5px); } 46%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }

/* health: a plan that ticks itself off */
.h-title, .c-title { font-size: 12px; font-weight: 600; color: var(--ink); }
.h-steps { list-style: none; display: flex; justify-content: space-between; gap: 6px; }
.h-steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink); }
.h-steps li::before { content: ''; width: 20px; height: 20px; border-radius: 50%; border: 1.6px solid #1E8E62; background: #1E8E62 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.4l2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; animation: tick var(--loop) ease infinite; animation-delay: calc(var(--n) * 1.1s - 8s); }
.h-track { height: 6px; background: rgba(255, 255, 255, 0.75); border-radius: 999px; overflow: hidden; }
.h-track i { display: block; height: 100%; width: 100%; background: #1E8E62; border-radius: 999px; transform-origin: left; animation: fillTrack var(--loop) ease infinite; }
@keyframes tick { 0%, 6% { background-color: transparent; background-size: 0; } 12%, 88% { background-color: #1E8E62; background-size: 12px; } 96%, 100% { background-color: transparent; background-size: 0; } }
@keyframes fillTrack { 0%, 4% { transform: scaleX(0); } 55%, 90% { transform: scaleX(1); } 97%, 100% { transform: scaleX(0); } }

/* security: a code that fills in, then verifies */
.c-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.c-boxes span { aspect-ratio: 1 / 1.15; background: #fff; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.c-boxes b { font-weight: 500; animation: digit var(--loop) ease infinite; animation-delay: calc(var(--n) * 0.4s - 8s); }
.c-ok { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #1E7A55; animation: verified var(--loop) ease infinite; }
.c-ok i { width: 8px; height: 8px; border-radius: 50%; background: #1E8E62; }
@keyframes digit { 0%, 8% { opacity: 0; transform: translateY(4px); } 14%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
@keyframes verified { 0%, 38% { opacity: 0; transform: translateY(4px); } 46%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }

/* places: someone finds a desk near their team */
.p-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.p-grid span { aspect-ratio: 1.25 / 1; border-radius: 6px; background: rgba(255, 255, 255, 0.85); }
.p-grid .who { background: #B9A6EA; position: relative; }
.p-grid .who::after { content: ''; position: absolute; inset: 30%; border-radius: 50%; background: #fff; opacity: 0.9; }
.p-grid .you { animation: seat var(--loop) ease infinite; animation-delay: calc(var(--n) * 2.6s - 8s); }
.p-note { font-size: 11.5px; color: var(--ink); font-weight: 600; }
@keyframes seat { 0%, 100% { background: rgba(255, 255, 255, 0.85); transform: none; } 6%, 24% { background: #1E8E62; transform: scale(1.14); } 32% { background: rgba(255, 255, 255, 0.85); transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .vg-ui * { animation: none !important; }
}
