/* /playground — single headline + one long alternating-side scatter
   (modelled on the Artist Collabs Site layout). Tiles are absolute-
   positioned at vh-anchored tops, alternating LEFT → RIGHT → CENTRE. */

/* Match the home page's hero headline (.hero-c) exactly — same family,
   weight, size clamp, line-height, letter-spacing, and ink colour. */
.page-playground .page-title.page-title--playground {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-style: normal;                  /* explicit: NOT italic */
  font-size: clamp(32px, 4.4vw, 64px);
  line-height: 1.15;
  letter-spacing: 0.002em;
  color: #1a1a2e;
  text-align: center;
  max-width: 1100px;
  margin: 8vh auto 14vh;
}
@media (max-width: 540px) {
  .page-playground .page-title.page-title--playground {
    font-size: clamp(28px, 9vw, 48px);
  }
}

/* Override the global "em renders italic" rule for this title — we want
   the headline rendered in plain roman across the board even if any
   inline <em> sneaks in via markdown / typo. */
.page-playground .page-title--playground em {
  font-style: normal;
}

/* Long canvas. min-height is set inline by playground.js once the
   tile count is known. */
.scatter-canvas {
  position: relative;
  width: 100%;
  margin: 0 auto;
  /* Fallback height in case JS doesn't run. */
  min-height: 200vh;
}

.scatter-item {
  position: absolute;
  /* Tile width is constrained but scales with viewport. */
  width: clamp(280px, 32vw, 640px);
  opacity: 0;
  filter: blur(8px);
  transform: translateY(10px);
  transition:
    opacity 700ms cubic-bezier(.2, .7, .2, 1.0),
    filter  700ms cubic-bezier(.2, .7, .2, 1.0),
    transform 700ms cubic-bezier(.2, .7, .2, 1.0);
}
.scatter-item.is-revealed {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* Alternating anchors — left edge, right edge, centred. */
.scatter-item.side-left {
  left: 6%;
  right: auto;
}
.scatter-item.side-right {
  right: 6%;
  left: auto;
}
.scatter-item.side-center {
  left: 50%;
  transform: translateX(-50%) translateY(10px);
}
.scatter-item.side-center.is-revealed {
  transform: translateX(-50%) translateY(0);
}

/* The clickable wrapper around the tile + (optionally) its title. */
.scatter-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* The media frame — every tile uses this; aspect-ratio set inline. */
.scatter-frame {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #f4f4f4;
  box-shadow:
    0 1px 2px rgba(15, 17, 22, 0.04),
    0 14px 36px rgba(15, 17, 22, 0.08);
  transition:
    transform 420ms cubic-bezier(.2, .7, .2, 1.0),
    box-shadow 420ms cubic-bezier(.2, .7, .2, 1.0);
}
.scatter-frame > img,
.scatter-frame > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Live-experiment iframes — fill the frame, ignore pointer events so
   clicks bubble to the wrapping <a class="scatter-link">. */
.scatter-frame > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none;
}

/* Hover lift */
.scatter-link:hover .scatter-frame {
  transform: translateY(-4px);
  box-shadow:
    0 1px 2px rgba(15, 17, 22, 0.06),
    0 26px 60px rgba(15, 17, 22, 0.14);
}

/* Title — only the live-experiment tiles have a visible title; the
   scraped tiles are visual-only. */
.scatter-title {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(20px, 1.6vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 18px 0 0;
  max-width: 90%;
}

/* Tablet — pull the side anchors closer to the edges. */
@media (max-width: 1000px) {
  .scatter-item { width: clamp(260px, 38vw, 500px); }
  .scatter-item.side-left  { left: 4%; }
  .scatter-item.side-right { right: 4%; }
}

/* Phone — single column, no per-side alternation; vertical spacing
   tightens up so all 40 items don't take a kilometre to scroll. */
@media (max-width: 640px) {
  .scatter-canvas {
    position: static;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 0 4vw;
  }
  .scatter-item,
  .scatter-item.side-left,
  .scatter-item.side-right,
  .scatter-item.side-center {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100%;
    max-width: 540px;
    transform: translateY(10px);
  }
  .scatter-item.is-revealed,
  .scatter-item.side-center.is-revealed {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scatter-item { transition: opacity 200ms ease; transform: none; }
  .scatter-item.is-revealed { filter: none; }
}
