/* ==========================================================================
   Olsaar v-next — feed phone (behaviour: js/feed.js).
   A vertical short-video feed inside the .clip--phone iPhone from css/clips.css:
   one reel plays, then the feed swipes up to the next.

   .feed              on the .clip--phone figure (with data-feed)
   .feed-still        the first poster, in the markup: the no-JS / reduced-motion state
   .feed-track/-slot  built by JS: two stacked slots, the next one waiting below
   .feed-ui           optional overlay (data-feed-handles): an example handle and a
                      neutral icon rail. No app branding, no counts.
   .feed-wall         a row of feed phones in a [data-feed-group]
   ========================================================================== */

.feed .phone-screen { background: #05070b; }

.feed-still,
.feed-slot video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #05070b;
}

.feed-track { position: absolute; inset: 0; }
.feed-slot {
  position: absolute;
  inset: 0;
  transform: translate3d(0, 0, 0);
  transition: transform 0.76s var(--ease-tide), filter 0.76s var(--ease-tide);
  will-change: transform;
}
.feed-slot.is-below { transform: translate3d(0, 100%, 0); }
/* The outgoing reel leaves a touch slower than the page and dims, like a real flick. */
.feed-slot.is-above { transform: translate3d(0, -100%, 0); filter: brightness(0.7); }
.feed-slot.is-reset { transition: none; }

/* ---------- Overlay ---------- */
.feed-ui {
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3cqi;
  padding: 0 5cqi 7.5cqi 6cqi;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
  color: #fff;
  pointer-events: none;
}
.feed-handle {
  display: inline-flex;
  align-items: center;
  gap: 2.4cqi;
  min-width: 0;
  font-size: max(4.4cqi, 0.625rem);
  font-weight: 620;
  letter-spacing: -0.005em;
  text-shadow: 0 0.2cqi 1.2cqi rgba(0, 0, 0, 0.35);
}
.feed-handle i {
  flex: none;
  width: 6.6cqi;
  height: 6.6cqi;
  border-radius: 50%;
  background: var(--flood);
  box-shadow: 0 0 0 0.5cqi rgba(255, 255, 255, 0.9);
}
.feed-handle b { font-weight: inherit; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.feed-rail {
  flex: none;
  display: grid;
  gap: 4.6cqi;
  margin-bottom: 1cqi;
}
.feed-rail svg {
  display: block;
  width: 7.4cqi;
  height: 7.4cqi;
  fill: none;
  stroke: #fff;
  stroke-width: 1.9;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0.2cqi 0.8cqi rgba(0, 0, 0, 0.35));
}

/* ---------- Many feeds ----------
   A row of phones, each running its own feed. --feed-cols sets the count;
   phones past it are hidden. The middle phone can be lifted with .is-lead. */
.feed-wall {
  --feed-cols: 5;
  display: grid;
  grid-template-columns: repeat(var(--feed-cols), minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 2rem);
  align-items: center;
}
.feed-wall > .clip--phone { max-width: none; }
.feed-wall .clip-cap { display: none; }
.feed-wall .phone-frame {
  box-shadow:
    inset 0 0 0 0.55cqi var(--phone-rim),
    inset 0 0 0 1.1cqi var(--phone-bezel),
    0 1.25rem 2.5rem -1.5rem rgba(5, 6, 8, 0.5);
}
/* A gentle arc: outer phones sit lower and a touch smaller. */
.feed-wall > :nth-child(1),
.feed-wall > :nth-child(5) { transform: translateY(8%) scale(0.9); }
.feed-wall > :nth-child(2),
.feed-wall > :nth-child(4) { transform: translateY(3%) scale(0.96); }
.feed-wall-foot { margin-top: clamp(1.5rem, 3vw, 2.5rem); }

@media (max-width: 900px) {
  .feed-wall { --feed-cols: 3; }
  .feed-wall > :nth-child(1),
  .feed-wall > :nth-child(5) { display: none; }
  .feed-wall > :nth-child(2),
  .feed-wall > :nth-child(4) { transform: translateY(5%) scale(0.92); }
}

/* Too small to read: drop the overlay rather than shrink it to noise. */
@container (max-width: 10rem) {
  .feed-ui { display: none; }
}

/* ---------- Account label (int1) ----------
   An example handle under a phone, outside the screen: a diagram label, not app UI. */
.feed-acct {
  display: block;
  margin-top: 0.75rem;
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--fg-2);
}
