/* Gallery v2 — one card per experiment: picture first, one line, two tags.
   The whole card opens the experience; only "Source" is a second link. No arrow glyphs. */

/* ---------- Intro: jump chips instead of three big picker cards ---------- */
.gallery-page .gg-projects.gx-jump {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 28px;
}
.gallery-page .gx-jump a {
  flex-direction: row; align-items: baseline; gap: 8px;
  min-height: 0; padding: 9px 14px;
  border-radius: 999px; background: #f2f3f5;
  font-size: 14px;
}
.gallery-page .gx-jump a small { font-size: 11px; letter-spacing: 0.04em; }
.gallery-page .gx-jump a strong { font-size: 15px; font-weight: 600; line-height: 1.2; }
.gallery-page .gg-intro .gg-word { width: auto; }

/* ---------- Grid ---------- */
.gx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.gallery-page .gx-card {
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0;
  border: 1px solid #e6e8ea !important;
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  background: #fff;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease;
}
.gallery-page .gx-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 40px -28px rgba(24, 28, 34, 0.35);
}
.gallery-page .gx-card:focus-within { box-shadow: 0 0 0 2px #9eafff; }

/* Picture */
.gx-visual {
  position: relative;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  overflow: hidden;
  background: #eef0f2;
}
.gx-visual > img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.gx-card:hover .gx-visual > img { transform: scale(1.035); }

/* Text */
.gx-body {
  display: grid; gap: 10px; align-content: start;
  padding: 22px 24px 24px;
}
.gallery-page .gx-card .gallery-heading { margin: 0; }
.gallery-page .gx-card .gallery-heading h2 { font-size: clamp(22px, 2.2vw, 28px); }
.gx-cover-link { color: inherit; text-decoration: none; }
/* The title link covers the whole card so the picture is clickable too. */
.gx-cover-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.gallery-page .gx-cover-link:focus-visible { outline: none; }
.gx-body > p { margin: 0; font-size: 16px; line-height: 1.5; color: #5f656c; max-width: 46ch; }
.gx-tags { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gx-tags li {
  font-size: 12px; color: #5f656c;
  padding: 5px 10px; border-radius: 999px; background: rgba(32, 33, 36, 0.06);
}
.gx-source {
  position: relative; z-index: 2;
  justify-self: start; margin-top: 4px;
  font-size: 13px; font-weight: 600; color: #5f656c;
  text-decoration: underline; text-underline-offset: 4px;
}
.gx-source:hover { color: #202124; }

/* ---------- The Awakening Loop: wide, dark, picture beside text ---------- */
.gallery-page .gx-wide { grid-column: 1 / -1; flex-direction: row; height: clamp(360px, 34vw, 460px); }
.gx-wide .gx-visual { flex: 1.5 1 0; aspect-ratio: auto; height: 100%; }
.gx-wide .gx-body { flex: 1 1 0; align-content: end; padding: 32px; }
.gallery-page .gx-dark { background: #121418; border-color: #121418 !important; }
body .gallery-page .gx-dark .gallery-heading h2 { color: #f3f4f6 !important; font-size: clamp(28px, 3vw, 40px); }
.gx-dark .gx-body > p { color: #a7adb5; }
.gx-dark .gx-tags li { color: #c9ced4; background: rgba(255, 255, 255, 0.08); }
.gx-loop .loop-cover-art { position: static; z-index: auto; width: 100%; height: 100%; opacity: 1; object-position: center 30%; }

/* ---------- MoodLog: the live picker card as its picture ---------- */
.gx-mood {
  display: grid; place-items: center;
  background: radial-gradient(120% 90% at 30% 20%, #f4f8ef, #e6eedf);
}
.gx-mood .moodlog-preview-card {
  position: relative; inset: auto;
  width: min(78%, 320px);
  transform: rotate(-4deg);
  animation: none;
}
.gx-card:hover .gx-mood .moodlog-preview-card { transform: rotate(-1deg) translateY(-4px); transition: transform 0.5s cubic-bezier(.2,.8,.2,1); }

/* MoodLog runs the full row too (its neighbour is hidden): text left, picture right, white card. */
.gallery-page .gx-wide.gx-flip { flex-direction: row-reverse; }
@media (min-width: 861px) {
  .gx-wide .gx-mood .moodlog-preview-card { width: min(62%, 420px); padding: 30px; }
  .gx-wide .gx-mood .moodlog-preview-card strong { font-size: 24px; }
  .gx-wide .gx-mood .moodlog-options { gap: 12px; margin-top: 24px; }
  .gx-wide .gx-mood .moodlog-options > span { padding: 16px 6px; font-size: 12px; }
  .gx-wide .gx-mood .moodlog-options img { width: 48px; height: 60px; }
}

/* ---------- Where the guide lands when it walks you to a card: a small pill over the picture ---------- */
.gx-card .gg-arrival {
  position: absolute; z-index: 3; top: 16px; left: 16px;
  display: flex; align-items: center; gap: 10px;
  min-height: 0; height: 48px; padding: 0 16px 0 4px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.gx-card .gg-arrival p { margin: 0; font-size: 14px; line-height: 1; color: #3c4046; white-space: nowrap; }
.gx-card .gg-arrival .gg-character { width: 160px; height: 160px; margin: -56px; transform: scale(0.25); flex-shrink: 0; pointer-events: none; }
.gx-card .gg-arrival :is(.gg-spark, .gg-speech, .gg-hand) { display: none; }

/* ---------- Narrow screens ---------- */
@media (max-width: 860px) {
  .gx-grid { grid-template-columns: minmax(0, 1fr); margin-top: 40px; }
  .gallery-page .gx-wide, .gallery-page .gx-wide.gx-flip { flex-direction: column; height: auto; }
  .gx-wide .gx-visual { aspect-ratio: 4 / 3; height: auto; flex: none; }
  .gx-wide .gx-body { padding: 22px 24px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-page .gx-card, .gx-visual > img, .gx-mood .moodlog-preview-card { transition: none; }
  .gallery-page .gx-card:hover { transform: none; }
  .gx-card:hover .gx-visual > img { transform: none; }
}

/* Card titles never take link colors. */
.gallery-page .gx-card .gallery-heading h2 .gx-cover-link,
.gallery-page .gx-card .gallery-heading h2 .gx-cover-link:visited { color: inherit !important; }
/* ---------- TikTok design test: wide, dark, mirrors the Awakening Loop at the end ---------- */
.gx-tt > img { object-position: left center; }
.tt-project { scroll-margin-top: 80px; }
