/* ── REELS FEED ─────────────────────────────
   Vertical, one reel per screen, inside the device card.
   Every video fills the screen edge to edge (cover); title, actions and the
   timeline float over a soft blue shade at the bottom. */
.feed {
  --ox: 50%; --oy: 100%;
  position: absolute; inset: 0; z-index: 20;
  color: var(--white);
  background:
    radial-gradient(90% 40% at 100% 100%, rgba(255, 255, 255, .2), transparent 60%),
    radial-gradient(80% 50% at 0% 100%, rgba(0, 110, 175, .5), transparent 70%),
    var(--blue);
  animation: feed-in .62s var(--ease) both;
}
.feed[hidden] { display: none; }
.feed.is-closing { animation: feed-out .38s cubic-bezier(.7, 0, .84, 0) both; }
@keyframes feed-in { from { clip-path: circle(0 at var(--ox) var(--oy)); } to { clip-path: circle(150% at var(--ox) var(--oy)); } }
@keyframes feed-out { from { clip-path: circle(150% at var(--ox) var(--oy)); } to { clip-path: circle(0 at var(--ox) var(--oy)); } }

.feed-scroll {
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none; outline: none;
}
.feed-scroll::-webkit-scrollbar { display: none; }

.feed-item {
  position: relative; height: 100%;
  overflow: hidden; isolation: isolate;
  scroll-snap-align: start; scroll-snap-stop: always;
}

/* the video: full screen, edge to edge */
.feed-stage { position: absolute; inset: 0; overflow: hidden; background: var(--blue-deep); }
.feed-stage > img, .feed-stage > video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.feed-stage > video { z-index: 1; }
/* soft shade so the title and actions read over the bottom of the video */
.feed-stage::before {
  content: ""; position: absolute; inset: auto 0 0; height: 48%; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 80, 140, .9), rgba(0, 110, 175, .35) 55%, transparent);
  transition: height .35s var(--ease);
}
.feed-item.is-desc-open .feed-stage::before { height: 85%; }

/* tap anywhere: play / pause */
.feed-tap {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent;
}
.feed-tap-icon {
  width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px;
  background: rgba(255, 255, 255, .22);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: scale(.8);
  transition: opacity .25s, transform .35s var(--ease);
}
.feed-tap-icon .i { margin-left: 3px; }
.feed-item.is-paused .feed-tap-icon { opacity: 1; transform: none; }
.feed-tap:focus-visible { outline: 2.5px solid var(--white); outline-offset: -8px; border-radius: 0; }

.feed-item.is-loading .feed-stage::after {
  content: ""; position: absolute; z-index: 3; top: 50%; left: 50%;
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 2px solid rgba(255, 255, 255, .3); border-top-color: var(--white); border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── info & action rail ── */
.feed-info {
  position: absolute; left: 20px; right: 84px; bottom: calc(52px + env(safe-area-inset-bottom)); z-index: 4;
  display: grid; gap: 6px; justify-items: start;
  pointer-events: none;
}
.feed-cat {
  padding: 5px 11px; border-radius: 999px;
  background: var(--white); color: var(--blue);
  font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.feed-title { font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.feed-client { font-size: 12.5px; font-weight: 700; color: var(--soft); }
.feed-desc-wrap { pointer-events: auto; }
.feed-desc {
  display: -webkit-box; overflow: hidden;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  font-size: 13px; font-weight: 500; line-height: 1.5; color: rgba(255, 255, 255, .9);
  cursor: pointer;
}
.feed-more { padding: 2px 0; font-size: 12.5px; font-weight: 800; color: var(--white); }
.feed-item.is-desc-open .feed-desc { display: block; max-height: 34vh; overflow-y: auto; }

.feed-rail {
  position: absolute; right: 12px; bottom: calc(52px + env(safe-area-inset-bottom)); z-index: 4;
  display: grid; gap: 14px; justify-items: center;
}
.rail-btn {
  display: grid; justify-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--white);
  -webkit-tap-highlight-color: transparent;
}
.rail-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px;
  background: rgba(255, 255, 255, .18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .25s, transform .2s var(--ease);
}
.rail-btn:hover .rail-icon { background: rgba(255, 255, 255, .3); }
.rail-btn:active .rail-icon { transform: scale(.88); }
.rail-btn[aria-pressed="true"] .rail-icon { background: var(--white); color: var(--blue); }

/* ── draggable timeline ── */
.feed-scrub {
  position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: center; height: 28px; padding: 0 18px;
  cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent;
}
.feed-progress {
  position: relative; flex: 1; height: 3px; border-radius: 3px;
  background: rgba(255, 255, 255, .3);
  transition: height .15s var(--ease);
}
.feed-progress > i {
  display: block; height: 100%; border-radius: inherit;
  background: var(--white);
  transform: scaleX(var(--progress, 0)); transform-origin: left;
}
.feed-scrub-thumb {
  position: absolute; top: 50%; left: calc(var(--progress, 0) * 100%);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--white); box-shadow: 0 0 0 4px rgba(0, 160, 229, .6);
  transform: translate(-50%, -50%) scale(0);
  transition: transform .15s var(--ease);
}
.feed-scrub:hover .feed-progress, .feed-scrub:focus-visible .feed-progress, .feed-item.is-scrubbing .feed-progress { height: 6px; }
.feed-scrub:hover .feed-scrub-thumb, .feed-scrub:focus-visible .feed-scrub-thumb, .feed-item.is-scrubbing .feed-scrub-thumb { transform: translate(-50%, -50%) scale(1); }
.feed-scrub:focus-visible { outline: none; }
.feed-scrub-time {
  position: absolute; left: 50%; bottom: calc(100% + 16px);
  padding: 5px 12px; border-radius: 999px;
  background: var(--white); color: var(--blue);
  font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; transform: translateX(-50%); transition: opacity .15s; pointer-events: none;
}
.feed-item.is-scrubbing .feed-scrub-time { opacity: 1; }
.feed-item.is-scrubbing :is(.feed-info, .feed-rail, .feed-tap-icon) { opacity: 0; transition: opacity .15s; }

/* ── top bar: back + the same (01) ──── 12 meter as the slides ── */
.feed-top {
  position: absolute; inset: 0 0 auto; z-index: 6;
  display: flex; align-items: center; gap: 14px;
  padding: calc(16px + env(safe-area-inset-top)) 20px 28px;
  padding-bottom: 60px;
  background: linear-gradient(to bottom, rgba(0, 80, 130, .38), transparent);
  pointer-events: none;
}
.feed-back {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px;
  background: rgba(255, 255, 255, .2); color: var(--white);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  transition: background .25s, transform .2s var(--ease);
}
.feed-back:hover { background: var(--white); color: var(--blue); }
.feed-back:active { transform: scale(.9); }
.feed-meter { flex: 1; margin: 0; }
.feed-meter .meter-num { width: 40px; height: 40px; font-size: 12px; background: rgba(0, 52, 86, .2); }
.feed-meter .meter-line::before { width: 100%; transform: scaleX(var(--fp, 0)); transition: transform .5s var(--ease); }
.feed .meter-total { color: var(--soft); }

/* ── hint & toast ── */
.feed-hint, .feed-toast {
  position: absolute; left: 50%; z-index: 7;
  padding: 8px 16px; border-radius: 999px;
  background: var(--white); color: var(--blue);
  font-size: 13px; font-weight: 800; pointer-events: none;
  transform: translateX(-50%);
}
.feed-hint { top: 40%; animation: hint 1.6s var(--ease) infinite; }
.feed-hint[hidden] { display: none; }
@keyframes hint { 50% { transform: translate(-50%, -14px); } }
.feed-toast { top: calc(84px + env(safe-area-inset-top)); opacity: 0; transition: opacity .3s; }
.feed-toast.is-on { opacity: 1; }

/* phone card on tablet/desktop has 48px corners: keep the timeline clear of them */
@media (min-width: 560px) {
  .feed-scrub { bottom: 20px; padding: 0 30px; }
  .feed-info, .feed-rail { bottom: 60px; }
}

/* short screens: actions in a row, tighter text */
@media (max-height: 560px) {
  .feed-rail { grid-auto-flow: column; gap: 8px; bottom: 46px; }
  .rail-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rail-icon { width: 40px; height: 40px; }
  .feed-info { right: 20px; bottom: 96px; }
  .feed-title { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .feed, .feed.is-closing, .feed-hint { animation: none; }
}
