/* Screenshot gallery, lightbox (every screenshot on the site opens full size) and floating
   app-style cards. Tokens come from site.css. */

/* ---------- Floating cards (small pieces of the app UI drifting by the screenshots) ---------- */

.fcard {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 14px 10px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(15, 17, 21, 0.07), 0 2px 4px rgba(15, 17, 21, 0.05), 0 18px 40px -14px rgba(15, 17, 21, 0.34);
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;
}
.fcard .ic {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 9px;
  background: #eaf2ff;
  color: var(--accent);
}
.fcard .ic.good { background: #e7f6ed; color: #17803f; }
.fcard .ic.warn { background: #fff3e0; color: #9a5800; }
.fcard .ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fcard strong { display: block; font-weight: 600; }
.fcard small { display: block; color: var(--muted); font-size: 11.5px; }
.fcard .num { font-variant-numeric: tabular-nums; }

/* Gentle drift, each card on its own rhythm. */
@media (prefers-reduced-motion: no-preference) {
  .fcard { animation: fcard-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both, drift 7s ease-in-out 0.8s infinite; }
  .fcard.d2 { animation-delay: 0.25s, 1.05s; animation-duration: 0.8s, 8.5s; }
  .fcard.d3 { animation-delay: 0.45s, 1.25s; animation-duration: 0.8s, 6.4s; }
  .fcard.d4 { animation-delay: 0.6s, 1.4s; animation-duration: 0.8s, 9s; }
}
@keyframes fcard-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes drift { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

/* Positions around a .stage screenshot */
.fc-intact { top: 18%; right: -4%; }
.fc-found { top: -26px; right: 14%; }
.fc-safe { bottom: 16%; left: -5%; }
.fc-photo { top: 8%; left: -6%; }
.fc-recovered { bottom: -22px; right: 10%; }

/* ---------- Gallery ---------- */

.gallery-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.gallery-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.gallery-tabs button {
  font: 500 14px/1 var(--font);
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.gallery-tabs button:hover { border-color: #cfd3da; color: var(--ink); }
.gallery-tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.gallery {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 28px 24px;
}
.gallery li { transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.gallery li[hidden] { display: none; }
.gallery li.wide { grid-column: span 2; }
.gallery button.g-item {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  cursor: zoom-in;
  border-radius: var(--radius);
}
.gallery button.g-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.g-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(15, 17, 21, 0.08), 0 2px 6px rgba(15, 17, 21, 0.05), 0 18px 40px -18px rgba(15, 17, 21, 0.3);
  background: #dde6f4;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
}
.g-frame img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 780; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.g-frame::after {
  content: "";
  position: absolute; right: 12px; top: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(15, 17, 21, 0.62) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5 9 7M2.5 13.5 7 9'/%3E%3C/svg%3E") center / 15px no-repeat;
  opacity: 0; transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.25s ease;
}
.g-item:hover .g-frame, .g-item:focus-visible .g-frame { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(15, 17, 21, 0.08), 0 4px 10px rgba(15, 17, 21, 0.06), 0 30px 60px -22px rgba(15, 17, 21, 0.38); }
.g-item:hover .g-frame img { transform: scale(1.025); }
.g-item:hover .g-frame::after, .g-item:focus-visible .g-frame::after { opacity: 1; transform: none; }
.g-caption { display: block; margin-top: 14px; }
.g-caption strong { display: block; color: var(--ink); font-size: 16px; font-weight: 600; }
.g-caption span { display: block; color: var(--muted); font-size: 14.5px; margin-top: 3px; }
.g-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; vertical-align: 2px; background: #eef0f3; color: #3d4350; }

/* Screenshots elsewhere on the page open the lightbox too. */
img.zoomable { cursor: zoom-in; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 56px 72px 24px;
  background: rgba(10, 12, 16, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.lightbox.open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; }
.lb-stage img {
  max-width: 100%; max-height: calc(100vh - 150px);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.96);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.2s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox.open .lb-stage img { transform: none; }
.lb-stage img.swap { opacity: 0; transform: scale(0.985); }
.lb-caption { text-align: center; color: #c9ced8; font-size: 15px; padding-top: 18px; }
.lb-caption strong { color: #fff; }
.lb-count { color: #8a909b; margin-left: 10px; font-variant-numeric: tabular-nums; }
.lb-btn {
  position: absolute;
  width: 46px; height: 46px; border-radius: 50%;
  border: 0;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.22); }
.lb-btn:active { transform: scale(0.94); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-close { top: 14px; right: 18px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-prev:active, .lb-next:active { transform: translateY(-50%) scale(0.94); }
.lb-prev[hidden], .lb-next[hidden] { display: none; }

@media (max-width: 900px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery li.wide { grid-column: span 2; }
  .fc-photo, .fc-safe { display: none; }
}
@media (max-width: 640px) {
  .lb-stage img { max-height: calc(100vh - 160px); }
  .gallery { grid-template-columns: 1fr; gap: 24px; }
  .gallery li.wide { grid-column: auto; }
  .fcard { font-size: 12px; padding: 8px 11px 8px 8px; }
  .fcard .ic { width: 26px; height: 26px; }
  .fc-intact { right: -2%; }
  .fc-found { right: 4%; }
  .lightbox { padding: 52px 8px 16px; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
  .lb-prev:active, .lb-next:active { transform: scale(0.94); }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lb-stage img, .g-frame, .g-frame img, .gallery li { transition: none; }
}

/* Two screenshots side by side (Mac and Windows section) */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin-top: 48px; }
.pair figure { margin: 0; }
.pair figcaption { margin-top: 14px; color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .pair { grid-template-columns: 1fr; gap: 32px; } }

/* Shown on phones only (below). */
.gallery-swipe { display: none; margin: 4px 0 0; font-size: 13px; color: var(--muted); }

/* Phones: the gallery is a row to swipe through; filters scroll sideways if they don't fit. */
@media (max-width: 640px) {
  .gallery-head { align-items: flex-start; }
  .gallery-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); scrollbar-width: none; }
  .gallery-tabs::-webkit-scrollbar { display: none; }
  .gallery-tabs button { flex: none; padding: 10px 16px; }
  .gallery {
    display: flex; gap: 14px;
    margin: 24px calc(-1 * var(--gutter)) 0;
    padding: 4px var(--gutter) 12px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .gallery li, .gallery li.wide { flex: 0 0 84%; grid-column: auto; scroll-snap-align: start; }
  .g-frame { border-radius: 10px; }
  .g-caption strong { font-size: 15px; }
  .g-caption span { font-size: 14px; }
  .g-frame::after { opacity: 1; transform: none; width: 30px; height: 30px; background-size: 13px; }
  .gallery-swipe { display: block; }
  .pair { margin-top: 32px; gap: 28px; }
}
