:root {
  --warwick-purple: #5B3A8C;
  --tile-radius: 6px;
  --tile-gap: 12px;
  --caption-bg: rgba(0, 0, 0, 0.62);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: transparent;
  color: #222;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--tile-gap);
}

@media (min-width: 600px) {
  .feed { grid-template-columns: repeat(3, 1fr); }
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--tile-radius);
  background: #f0ecf5;
}

.tile a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 250ms ease;
}

.tile a:hover img,
.tile a:focus img { transform: scale(1.03); }

.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.play-icon {
  width: 30%;
  max-width: 64px;
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55));
  transition: transform 200ms ease, background 200ms ease;
}

.play-icon svg {
  width: 55%;
  height: 55%;
  display: block;
  /* Optical centring: the triangle's visual centre sits left of its bounding box. */
  margin-left: 8%;
}

.play-overlay:hover .play-icon,
.play-overlay:focus-visible .play-icon {
  transform: scale(1.08);
  background: rgba(0, 0, 0, 0.6);
}

.play-overlay:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 8px 10px;
  background: var(--caption-bg);
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(10%);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}

@media (hover: hover) {
  .tile a:hover .caption,
  .tile a:focus-visible .caption {
    opacity: 1;
    transform: translateY(0);
  }
}

/* On touch devices, always show the caption (truncated) below the image area */
@media (hover: none) {
  .caption {
    opacity: 1;
    transform: none;
    background: rgba(0, 0, 0, 0.55);
  }
}

.follow {
  text-align: center;
  margin: 18px 0 6px;
  font-weight: 500;
}

.follow a {
  color: var(--warwick-purple);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.follow a:hover { color: #3f2563; }

.generated {
  text-align: center;
  margin: 0 0 8px;
  color: #888;
  font-size: 11px;
}
