.work {
  background: #003c33;
  overflow: hidden;
}

.work .section-head { margin-bottom: 34px; }
.work .section-foot { border-color: rgba(255, 255, 255, .24); }
.work .section-foot .text-link { color: #d9f99d; }

.phone-carousel {
  --phone-width: clamp(214px, 22vw, 302px);
  --phone-gap: clamp(16px, 4vw, 58px);
  position: relative;
  width: 100%;
  overflow: hidden;
}

.phone-carousel::before,
.phone-carousel::after {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 50px;
  width: min(9vw, 110px);
  content: "";
  pointer-events: none;
}

.phone-carousel::before { left: 0; background: linear-gradient(90deg, #003c33, transparent); }
.phone-carousel::after { right: 0; background: linear-gradient(270deg, #003c33, transparent); }

.phone-carousel__viewport { width: 100%; overflow: hidden; }
.phone-carousel__track {
  display: flex;
  align-items: center;
  gap: var(--phone-gap);
  width: max-content;
  padding: 10px max(var(--phone-gap), calc(50vw - var(--phone-width) / 2)) 26px;
  animation: phone-drift 39s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}
.phone-carousel__track.is-moving { animation-play-state: running; }

.phone-card {
  flex: 0 0 var(--phone-width);
  opacity: .62;
  filter: brightness(.66) saturate(.85);
  transform: scale(.85);
  transition: opacity .55s ease, filter .55s ease, transform .55s ease;
}
.phone-card.is-active { z-index: 2; opacity: 1; filter: none; transform: scale(1); }

.phone-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  padding: 8px;
  border: 2px solid #e6ebe9;
  border-radius: 43px;
  background: #84908b;
  box-shadow: inset 0 0 0 4px #afb7b3, 0 18px 48px rgba(0, 0, 0, .16);
}
.phone-frame::before,
.phone-frame::after {
  position: absolute;
  right: 100%;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: #aeb8b3;
  content: "";
}
.phone-frame::before { top: 22%; height: 28px; }
.phone-frame::after { top: 33%; height: 43px; }

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 34px;
  background: #16211e;
}
.phone-screen::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.36), transparent 23%, transparent 56%, rgba(0,0,0,.66));
  content: "";
  pointer-events: none;
}
.phone-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.phone-island {
  position: absolute;
  z-index: 5;
  top: 19px;
  left: 50%;
  width: 33%;
  height: 22px;
  border-radius: 99px;
  background: #06100e;
  transform: translateX(-50%);
  pointer-events: none;
}
.phone-island::before,
.phone-island::after { position: absolute; top: 8px; width: 6px; height: 6px; border-radius: 50%; content: ""; }
.phone-island::before { left: 14px; background: #1a3430; }
.phone-island::after { right: 14px; background: #91aca6; }
.phone-home {
  position: absolute;
  z-index: 5;
  bottom: 17px;
  left: 50%;
  width: 35%;
  height: 4px;
  border-radius: 99px;
  background: white;
  transform: translateX(-50%);
  pointer-events: none;
}

.phone-ui {
  position: absolute;
  z-index: 2;
  inset: 0;
  padding: 35px 13px 42px;
  color: #fff;
  font-family: var(--body);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
  pointer-events: none;
}
.phone-ui__top { display: flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; font-size: 9px; font-weight: 700; }
.phone-ui__top span { opacity: .7; }
.phone-ui__top strong { position: relative; font-size: 10px; }
.phone-ui__top strong::after { position: absolute; bottom: -5px; left: 15%; width: 70%; height: 2px; background: #fff; content: ""; }
.phone-ui__top svg { width: 12px; height: 12px; }
.phone-ui__rail { position: absolute; right: 12px; bottom: 82px; display: grid; gap: 17px; }
.phone-ui__rail svg { display: block; width: 24px; height: 24px; stroke-width: 2.5; filter: drop-shadow(0 2px 3px #0008); }
.phone-ui__caption { position: absolute; left: 15px; right: 50px; bottom: 44px; display: grid; gap: 4px; font-size: 11px; line-height: 1.25; }
.phone-ui__caption strong { font-size: 13px; }
.phone-post-link { position:absolute; z-index:4; right:12px; bottom:12px; display:inline-flex; align-items:center; gap:4px; min-height:32px; padding:7px 9px; border-radius:999px; background:#d9f99d; color:#003c33; font-size:11px; font-weight:800; line-height:1; text-shadow:none; box-shadow:0 6px 18px #0006; }
.phone-post-link[hidden] { display:none; }
.phone-post-link svg { width:13px; height:13px; stroke-width:2.5; }
.phone-ui,.phone-ui * { pointer-events:none !important; }
.video-audio-note { margin:10px 0 0; color:#e4eee8; font-size:14px; }
@keyframes phone-drift {
  from { transform: translateX(var(--loop-start, 0px)); }
  to { transform: translateX(var(--loop-end, -50%)); }
}

@media (max-width: 720px) {
  .work .section-head { margin-bottom: 20px; }
  .phone-carousel { --phone-width: min(71vw, 285px); --phone-gap: 15px; }
  .phone-carousel::before, .phone-carousel::after { width: 8vw; }
  .phone-carousel__track { padding-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .phone-carousel__track { animation: none; transform: var(--static-position, translateX(0)); will-change: auto; }
  .phone-card { transition: none; }
}
