﻿/* =========================================================
   37-style responsive interactions
   WOW entrances + slide-up card overlays
   ========================================================= */
.wow[data-anim] {
  opacity: 1;
  transform: none;
}
.wow.animated {
  animation-fill-mode: backwards;
}

/* keep the reveal observer from double-hiding WOW elements */
.work-card .thumb {
  position: relative;
}

/* ---------- slide-up work overlay ---------- */
.work-hover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(91, 64, 56, .18) 0%, rgba(91, 64, 56, .92) 54%, rgba(80, 55, 47, .97) 100%);
  color: var(--paper);
  transform: translateY(102%);
  transition: transform .55s var(--ease);
  pointer-events: none;
}
.hover-cat {
  display: block;
  color: var(--yellow);
  font-family: var(--hand);
  font-size: 11px;
  letter-spacing: .05em;
}
.work-hover strong {
  display: block;
  margin-top: 5px;
  color: var(--paper);
  font-family: var(--hand);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.15;
}
.work-hover em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(253, 248, 237, .55);
  color: rgba(253, 248, 237, .82);
  font-family: var(--hand);
  font-size: 11px;
  font-style: normal;
}
.work-hover em i { font-style: normal; }

/* QR inside the four selected work overlays */
.hover-qr {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 92px;
  margin: 0;
  padding: 5px 5px 4px;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 7px 10px 6px 9px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .18);
  text-align: center;
}
.hover-qr img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
}
.hover-qr figcaption {
  margin-top: 3px;
  color: var(--ink);
  font-family: var(--hand);
  font-size: 11px;
  line-height: 1.2;
}
.work-card:hover .work-hover,
.work-card:focus-visible .work-hover {
  transform: translateY(0);
}
.work-card:hover .thumb > span,
.work-card:focus-visible .thumb > span {
  opacity: 0;
}

/* contact postcard: personal WeChat QR on hover */
.postcard-scene .postcard-img {
  transition: transform .6s var(--ease);
}
.postcard:hover .postcard-scene .postcard-img,
.postcard:focus-within .postcard-scene .postcard-img {
  transform: scale(1.04);
}
.postcard-qr {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  background: rgba(253, 248, 237, .96);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  pointer-events: none;
}
.postcard-qr img {
  display: block;
  width: auto;
  height: 190px;
  max-width: 100%;
  object-fit: contain;
  padding: 4px;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
}
.postcard-qr span {
  color: var(--ink);
  font-family: var(--hand);
  font-size: 13px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--ink);
}
.postcard:hover .postcard-qr,
.postcard:focus-within .postcard-qr {
  opacity: 1;
  transform: translateY(0);
}

/* mobile / touch: the overlay is a permanent bottom caption,
   like the mobile version of 37, instead of a hover-only state */
@media (max-width: 820px), (hover: none) {
  .work-hover {
    inset: auto 0 0;
    height: 54%;
    justify-content: flex-end;
    padding: 10px;
    background: linear-gradient(0deg, rgba(80, 55, 47, .94) 0%, rgba(80, 55, 47, .64) 52%, transparent 100%);
    transform: none;
  }
  .hover-cat { display: none; }
  .work-hover strong { margin-top: 0; font-size: 18px; }
  .work-hover em { margin-top: 4px; font-size: 9px; }
  .works .work-caption, .works .work-card > h4 { display: none; }
  .work-card:hover .thumb > span, .work-card .thumb > span { opacity: 1; }
}

/* responsive header / card polish */
@media (max-width: 820px) {
  .topbar.wow.fadeInDownBig { animation-duration: .75s; }
  .skill-card.wow { animation-duration: .7s; }
  .cat-block.wow { animation-duration: .7s; }
  .hero.wow { animation-duration: .8s; }
}

@media (prefers-reduced-motion: reduce) {
  .wow, .wow.animated {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .work-hover, .postcard-qr, .postcard-scene .postcard-img { transition: none; }
}






/* center the QR versions: QR above the text, whole block centered */
.work-hover.has-qr {
  align-items: flex-start;
  justify-content: flex-end;
  padding: 16px;
  text-align: left;
}
.work-hover.has-qr .hover-qr {
  position: absolute;
  top: 12px;
  left: 50%;
  right: auto;
  width: 88px;
  margin: 0;
  transform: translateX(-50%);
}
.work-hover.has-qr strong { margin-top: 5px; }
.work-hover.has-qr em { align-self: flex-start; }



/* +2px for QR caption span */
.postcard-qr span { font-size: 15px; }
