/* Card hovers (alt-hover.js), carried over from the live styles.css: the same timings,
   scales and moves, at the new cards' positions. */

.case-card__slot img, .construction__product, .connect__card { transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }

/* Ease CheckIn: the phone grows 1.0404 around a point 80px from its top. On hover the
   check-in slider video fades in over it, masked to the phone's outline. The phone stays
   underneath: it is the video's first frame, so nothing dips while the two cross (it
   blinked when the phone faded out at the same time as the video faded in). */
.checkin__phone { transform-origin: 50% 80px; transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.checkin__video {
  position: absolute;
  top: 32px;
  left: 209px;
  width: 184px;
  height: auto;
  opacity: 0;
  transform-origin: 50% 80px;
  transition: opacity 0.25s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-mask: var(--mask-what-changed) 0 0 / 100% 100% no-repeat;
  mask: var(--mask-what-changed) 0 0 / 100% 100% no-repeat;
}
.case-card--checkin:hover .checkin__phone { transform: scale(1.0404); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .case-card--checkin:hover .checkin__video { opacity: 1; transform: scale(1.0404); }
}

/* Infobric Connect: the three screens fan out */
.case-card--connect:hover .connect__card--back2 { transform: translate(11.42px, 5.69px) rotate(10deg); }
.case-card--connect:hover .connect__card--back1 { transform: translate(5.74px, 8.14px) rotate(-10deg); }
.case-card--connect:hover .connect__card--front { transform: translate(12.84px, 8.41px); }

/* Ease Construction: the product grows 288 → 296px and the GIF replaces the still */
.construction__gif { opacity: 0; }
.case-card--construction:hover .construction__product { transform: scale(1.02778); }
.case-card--construction:hover .construction__gif { opacity: 1; }

/* Side projects: no case yet; the picture turns gray and the cursor shows the note */
.card-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* read by screen readers, shown by the cursor */
/* Touch: a tap on the picture shows the note as a pill in its middle (alt-hover.js) */
.case-card.is-noted .card-note {
  left: 50%;
  top: 0;
  margin-top: 26.53%; /* the middle of the picture: 156 of 588, as a share of the card's width */
  z-index: 3;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  padding: 12px 24px;
  border-radius: 28px;
  background: #f0eeee;
  color: #3d200e;
  font-weight: 600;
  line-height: 24px;
  box-shadow: 0 2px 8px rgba(31, 30, 30, 0.12);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.case-card.is-noted .case-card__slot { filter: grayscale(1); }
.case-card--side .case-card__slot { transition: filter 0.3s; }
.has-card-cursor .case-card--side .case-card__slot:hover { filter: grayscale(1); }

/* Cursor: an inverting dot that grows into a 56px "View" circle over a card */
.has-card-cursor, .has-card-cursor * { cursor: none; }
.has-card-cursor a:not(.case-card__cover), .has-card-cursor a:not(.case-card__cover) *,
.has-card-cursor button, .has-card-cursor button * { cursor: pointer; }
.card-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 500;
  pointer-events: none;
  mix-blend-mode: exclusion;
  opacity: 0;
  transition: opacity 0.2s;
}
.card-cursor.is-on { opacity: 1; }
.card-cursor__dot {
  position: absolute;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  transform: scale(0.18);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.35s cubic-bezier(0.22, 1, 0.36, 1), margin 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.card-cursor.is-big .card-cursor__dot { transform: scale(1); }
.card-cursor__text { font-weight: 600; line-height: 24px; color: #3d200e; white-space: nowrap; opacity: 0; transition: opacity 0.2s; }
.card-cursor.is-big .card-cursor__text { opacity: 1; }
.card-cursor.is-note { mix-blend-mode: normal; }
.card-cursor.is-note .card-cursor__dot { background: #f0eeee; box-shadow: 0 2px 8px rgba(31, 30, 30, 0.12); transform: scale(1); width: var(--note-w); height: var(--note-h); margin-top: calc(var(--note-h) / -2); border-radius: 28px; overflow: hidden; }
.card-cursor.is-note.is-note-left .card-cursor__dot { margin-left: calc(28px - var(--note-w)); }
.card-cursor.is-note .card-cursor__text { opacity: 0; transition-duration: 0.1s; }
.card-cursor__note { position: absolute; left: 0; top: 0; padding: 12px 24px; font-weight: 600; line-height: 24px; color: #3d200e; white-space: nowrap; opacity: 0; transition: opacity 0.15s; }
.card-cursor.is-note .card-cursor__note { opacity: 1; transition: opacity 0.25s 0.15s; }

/* Light under the pointer, inside the picture */
.card-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  background: radial-gradient(240px circle at var(--lx, -999px) var(--ly, -999px), rgba(255, 255, 255, 0.157), transparent 60%);
}
.case-card.is-lit .card-light { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .case-card__slot img, .construction__product, .connect__card, .checkin__phone { transition: none; }
}
